当前位置: 首页>>代码示例>>C#>>正文


C# Forms.VScrollBar类代码示例

本文整理汇总了C#中System.Windows.Forms.VScrollBar的典型用法代码示例。如果您正苦于以下问题:C# VScrollBar类的具体用法?C# VScrollBar怎么用?C# VScrollBar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


VScrollBar类属于System.Windows.Forms命名空间,在下文中一共展示了VScrollBar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MetroDataGridHelper

        public MetroDataGridHelper(MetroScrollBar scrollbar, DataGridView grid, bool vertical = true)
        {
            _scrollbar = scrollbar;
            _scrollbar.UseBarColor = true;
            _grid = grid;
            _ishorizontal = !vertical;

            foreach (var item in _grid.Controls)
            {
                if (item.GetType() == typeof(VScrollBar))
                {
                    vScrollbar = (VScrollBar)item;
                }

                if (item.GetType() == typeof(HScrollBar))
                {
                    hScrollbar = (HScrollBar)item;
                }
            }

            _grid.RowsAdded += new DataGridViewRowsAddedEventHandler(_grid_RowsAdded);
            _grid.UserDeletedRow += new DataGridViewRowEventHandler(_grid_UserDeletedRow);
            _grid.Scroll += new ScrollEventHandler(_grid_Scroll);
            _grid.Resize += new EventHandler(_grid_Resize);
            _scrollbar.Scroll += _scrollbar_Scroll;
            _scrollbar.ScrollbarSize = 17;

            UpdateScrollbar();
        }
开发者ID:flexboj,项目名称:winforms-modernui,代码行数:29,代码来源:MetroGrid.cs

示例2: CustomList

		protected CustomList(string name)
		{
			this.name=name;
			SetStyle(ControlStyles.AllPaintingInWmPaint|ControlStyles.DoubleBuffer|ControlStyles.UserPaint,true);

			collection = new ArrayList();

			vert = new VScrollBar();
			vert.Height=Height;
			vert.Location=new Point(Width-vert.Width,0);
			vert.Minimum=0;
			vert.Maximum=1;
			vert.Scroll+=new ScrollEventHandler(scroll);
			Controls.Add(vert);

			strList = new string[]{"Edit","Delete"};

			border = Border3DStyle.Etched;
			bStyle=BorderStyle.None;

			properties = new StrPropertyList();

			StrProperty.Update+=new NoArgsDelegate(Refresh);
//			allowedChars = new Hashtable();
//			allowedChars[Keys.Space]=' ';
		}
开发者ID:pmprog,项目名称:OpenXCOM.Tools,代码行数:26,代码来源:CustomList.cs

示例3: Form1

        public Form1()
        {
            var back = BackColor;
            BackColor = Color.Black;
            button1 = new Button { Text = "×", TabIndex = 8, BackColor = back };
            button2 = new Button { Text = "|", TabIndex = 9, BackColor = back };
            button3 = new Button { Text = "O", TabIndex = 0, BackColor = back };
            vscrollBar1 = new VScrollBar { Maximum = 0, LargeChange = 10, BackColor = back };
            ofd.Filter = "無圧縮 ZIP ファイル (*.zip)|*.zip|すべてのファイル (*.*)|*.*";

            Text = "JPEG Viewer";
            if (Utils.IsWinCE)
            {
                TopMost = true;
                FormBorderStyle = FormBorderStyle.None;
                Bounds = Screen.PrimaryScreen.Bounds;
            }
            else
            {
                ClientSize = new Size(800, 480);
            }

            button1.Click += (sender, e) => Close();
            button2.Click += (sender, e) => this.Minimize();
            button3.Click += button3_Click;
            vscrollBar1.ValueChanged += (sender, e) =>
                setImage((vscrollBar1.Maximum - 9) - vscrollBar1.Value);

            Controls.Add(button1);
            Controls.Add(button2);
            Controls.Add(button3);
            Controls.Add(vscrollBar1);

            timer.Tick += timer_Tick;
        }
开发者ID:7shi,项目名称:JpegViewer,代码行数:35,代码来源:Form1.cs

示例4: SpreadsheetPanel

        /// <summary>
        /// Creates an empty SpreadsheetPanel
        /// </summary>
        public SpreadsheetPanel()
        {
            InitializeComponent();

            // The DrawingPanel is quite large, since it has 26 columns and 99 rows.  The
            // SpreadsheetPanel itself will usually be smaller, which is why scroll bars
            // are necessary.
            drawingPanel = new DrawingPanel(this);
            drawingPanel.Location = new Point(0, 0);
            drawingPanel.AutoScroll = false;

            // A custom vertical scroll bar.  It is designed to scroll in multiples of rows.
            vScroll = new VScrollBar();
            vScroll.SmallChange = 1;
            vScroll.Maximum = ROW_COUNT;

            // A custom horizontal scroll bar.  It is designed to scroll in multiples of columns.
            hScroll = new HScrollBar();
            hScroll.SmallChange = 1;
            hScroll.Maximum = COL_COUNT;

            // Add the drawing panel and the scroll bars to the SpreadsheetPanel.
            Controls.Add(drawingPanel);
            Controls.Add(vScroll);
            Controls.Add(hScroll);

            // Arrange for the drawing panel to be notified when it needs to scroll itself.
            hScroll.Scroll += drawingPanel.HandleHScroll;
            vScroll.Scroll += drawingPanel.HandleVScroll;
        }
开发者ID:jiiehe,项目名称:cs3500,代码行数:33,代码来源:SpreadsheetPanel.cs

示例5: ImageViewer

        public ImageViewer()
        {
            InitializeComponent();

            _ClientWidth = ClientSize.Width;
            _ClientHeight = ClientSize.Height;

            _VScrollBar = new VScrollBar();
            _VScrollBar.Maximum = 0;
            _VScrollBar.Minimum = 0;
            _VScrollBar.Size = new Size(15, _ClientHeight);
            _VScrollBar.Value = 0;
            _VScrollBar.Scroll += OnVerticalScrollBarPositionChanged;
            _VScrollBar.Location = new Point(_ClientWidth - 15, 0);
            Controls.Add(_VScrollBar);

            _BufferImage = new Bitmap(_ClientWidth - 15, _ClientHeight, PixelFormat.Format24bppRgb);
            _BufferImageWidth = _BufferImage.Width;
            _BufferImageHeight = _BufferImage.Height;

            using(Graphics g = Graphics.FromImage(_BufferImage))
            {
                g.Clear(Color.White);
            }
        }
开发者ID:WildGenie,项目名称:uo-atlas-ob,代码行数:25,代码来源:ImageViewer.cs

示例6: Game1

        public Game1(IntPtr drawSurface,
            System.Windows.Forms.Form parentForm,
            System.Windows.Forms.PictureBox surfacePictureBox)
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            this.drawSurface = drawSurface;
            this.parentForm = parentForm;
            this.pictureBox = surfacePictureBox;

            graphics.PreparingDeviceSettings +=
                new EventHandler<PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings);

            Mouse.WindowHandle = drawSurface;

            gameForm = System.Windows.Forms.Control.FromHandle(this.Window.Handle);
            gameForm.VisibleChanged += new EventHandler(gameForm_VisibleChanged);
            pictureBox.SizeChanged += new EventHandler(pictureBox_SizeChanged);

            vscroll = (VScrollBar) parentForm.Controls["vScrollBar1"];
            hscroll = (HScrollBar)parentForm.Controls["hScrollBar1"];
            tileSelector = (ComboBox) parentForm.Controls["comboBox1"];
            tileSelector.SelectedIndexChanged += new EventHandler(tileSelector_IndexChanged);
        }
开发者ID:rjr5838,项目名称:Vegetable-Slayer,代码行数:25,代码来源:Game1.cs

示例7: PagePreview

        /// <summary>
        /// Initializes a new instance of the <see cref="PagePreview"/> class.
        /// </summary>
        public PagePreview()
        {
            _canvas = new PagePreviewCanvas(this);
            Controls.Add(_canvas);

            _hScrollBar = new HScrollBar();
            _hScrollBar.Visible = _showScrollbars;
            _hScrollBar.Scroll += OnScroll;
            _hScrollBar.ValueChanged += OnValueChanged;
            Controls.Add(_hScrollBar);

            _vScrollBar = new VScrollBar();
            _vScrollBar.Visible = _showScrollbars;
            _vScrollBar.Scroll += OnScroll;
            _vScrollBar.ValueChanged += OnValueChanged;
            Controls.Add(_vScrollBar);

            InitializeComponent();
            //OnLayout();

            _zoom = Zoom.FullPage;
            _printableArea = new RectangleF();
            //virtPageSize = new Size();
            //showNonPrintableArea = false;
            //virtualPrintableArea = new Rectangle();

            _printableArea.GetType();
            //showNonPrintableArea.GetType();
            //virtualPrintableArea.GetType();

            // Prevent bogus compiler warnings
            _posOffset = new Point();
            _virtualPage = new Rectangle();
        }
开发者ID:Core2D,项目名称:PDFsharp,代码行数:37,代码来源:PagePreview.cs

示例8: LogControl

        public LogControl()
        {
            this.InitializeComponent();

            this.SetStyle( ControlStyles.UserPaint, true );
            this.SetStyle( ControlStyles.AllPaintingInWmPaint, true );
            this.SetStyle( ControlStyles.ResizeRedraw, true );
            this.SetStyle( ControlStyles.Opaque, true );
            this.SetStyle( ControlStyles.OptimizedDoubleBuffer, true );

            _verticalScrollBar = new VScrollBar();
            _verticalScrollBar.Scroll += new ScrollEventHandler( _verticalScrollBar_Scroll );
            _verticalScrollBar.Dock = DockStyle.Right;
            _verticalScrollBar.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right;
            _verticalScrollBar.Left = this.ClientSize.Width - 2 - _verticalScrollBar.Width;
            _verticalScrollBar.Top = 2;
            _verticalScrollBar.Height = this.ClientSize.Height - 4;
            this.Controls.Add( _verticalScrollBar );

            this.SetupGraphics();
            this.CalculateSize( true );

            this.copyAllToolStripMenuItem.Click += new EventHandler( copyAllToolStripMenuItem_Click );
            this.clearToolStripMenuItem.Click += new EventHandler( clearToolStripMenuItem_Click );
            this.ContextMenuStrip = contextMenuStrip;

            // Build feature list
            List<string> featureNames = new List<string>();
            foreach( string feature in Enum.GetNames( typeof( Feature ) ) )
                featureNames.Add( new string( ' ', 10 - feature.Length ) + feature );
            _featureNames = featureNames.ToArray();
        }
开发者ID:BradFuller,项目名称:pspplayer,代码行数:32,代码来源:LogControl.cs

示例9: ScrollableListView

        public ScrollableListView(
            int countToShow
            )
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();
            Scrollable = true;
            _countToShow = countToShow;
            // Create and initialize a VScrollBar.
            vScrollBar1 = new VScrollBar();
            vScrollBar1.Size = new Size(15, Height);
            // Dock the scroll bar to the right side of the form.
            vScrollBar1.Dock = DockStyle.Right;

            vScrollBar1.Scroll += vScrollBar1_Scroll;

            // Add the scroll bar to the form.
            Controls.Add(vScrollBar1);
            setvScrollBar1MaxValueDelegate =
                SetScrollBarMaxValue;
            //                Delegate.CreateDelegate
            //                (
            //                typeof(SetIntAccessorDelegate),
            //                vScrollBar1,
            //                "set_Maximum"
            //                ) as SetIntAccessorDelegate;
            Resize += ScrollableListView_Resize;
        }
开发者ID:alienwaredream,项目名称:toolsdotnet,代码行数:28,代码来源:ScrollableListView.cs

示例10: myContactList

        protected myContactList()
        {
            SetStyle(ControlStyles.UserPaint, true); // Рисуем всё сами
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            this.Visible = true;
            vscroll = new VScrollBar();
            vscroll.Dock = DockStyle.Right;
            vscroll.Visible = false;
            this.Controls.Add(vscroll);

            vscroll.SmallChange = 1; // На какое количество контактов смещаться (стрелочка)
            vscroll.LargeChange = 60; // На какое кол-во контактов смещаться (поле)
            //vscroll.Maximum = Items.Count * HEIGHT_ITEM - this.Height + vscroll.LargeChange;
            vscroll.ValueChanged += new EventHandler(vscroll_ValueChanged);

            //ToolStripItem item = new ToolStripItem();
            context.ItemClicked += new ToolStripItemClickedEventHandler(context_ItemClicked);
            context.VisibleChanged += new EventHandler(context_VisibleChanged);

            tip.AutoPopDelay = 15000; // Сколько будет видна доп.информация
            tip.InitialDelay = 0;
            tip.OwnerDraw = true; // Рисуем сами
            tip.Draw += new DrawToolTipEventHandler(tip_Draw);

            timer.Tick += new EventHandler(timer_Tick_About);
        }
开发者ID:malstoun,项目名称:VKMessenger,代码行数:28,代码来源:myListBox.cs

示例11: TreeViewEx

    public TreeViewEx()
    {
        this.nodes = new TreeNodeCollectionEx(this);

        // initialise scroll bar
        this.vScrollBar = new WinForms.VScrollBar();

        this.vScrollBar.Minimum = this.vScrollBar.Maximum = 0;
        this.vScrollBar.Dock = WinForms.DockStyle.Right;
        this.vScrollBar.Visible = false;

        this.vScrollBar.Scroll += new WinForms.ScrollEventHandler(OnVerticalScroll);

        this.Controls.Add( vScrollBar );

        // initialise tool tip
        this.toolTip = new WinForms.ToolTip();
        this.toolTip.Active = true;

        this.AllowDrop = this.AllowMovementOfNodes;

        this.SetStyle(WinForms.ControlStyles.DoubleBuffer | WinForms.ControlStyles.UserPaint |
        WinForms.ControlStyles.AllPaintingInWmPaint, true);

        this.BackColor = Drawing.Color.White;
    }
开发者ID:peteward44,项目名称:nbm-messenger,代码行数:26,代码来源:TreeViewEx.cs

示例12: Disassembly

        public Disassembly(USBGecko UGecko, String UVdappPath, ListBox UMainBox,
            VScrollBar UScroll,TextBox UAInput,TextBox UASAddress,TextBox UASText,ExceptionHandler UEXCHandler)
        {
            gecko = UGecko;
            exceptionHandling = UEXCHandler;
            vdappPath = UVdappPath;
            if (!GlobalFunctions.tryToHex(GeckoApp.Properties.Settings.Default.MemViewAddr, out cAddress))
            {
                // If the restored value is corrupt, use this instead
                cAddress = 0x80003100;
            }
            scrollbar = UScroll;
            mainBox = UMainBox;
            adressInput = UAInput;
            asAddress = UASAddress;
            asText = UASText;

            mainBox.SelectedIndexChanged += MainBoxClick;
            mainBox.DoubleClick += MainBoxDoubleClick;
            mainBox.KeyDown += MainBoxKeyDown;
            scrollbar.Scroll += Scrolling;
            
#if MONO
			GAs = "powerpc-eabi-as";
			GLd = "powerpc-eabi-ld";
			GOc = "powerpc-eabi-objcopy";
#else
            GAs = "powerpc-gekko-as.exe";
            GLd = "powerpc-gekko-ld.exe";
            GOc = "powerpc-gekko-objcopy.exe";
#endif
        }
开发者ID:PokeAcer549,项目名称:geckowii,代码行数:32,代码来源:disassembly.cs

示例13: Strategy_Layout

        VScrollBar VScrollBarStrategy; // Vertical scrollbar

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Initializes the strategy field
        /// </summary>
        public Strategy_Layout(Strategy strategy)
        {
            this.strategy      = strategy;
            slots              = strategy.Slots;
            slotMinMidMax      = SlotSizeMinMidMax.mid;
            toolTip            = new ToolTip();
            flowLayoutStrategy = new FlowLayoutPanel();
            VScrollBarStrategy = new VScrollBar();
            apnlSlot           = new Panel[slots];
            pnlProperties      = new Panel();

            for (int iSlot = 0; iSlot < slots; iSlot++)
                apnlSlot[iSlot] = new Panel();

            if (bShowRemoveSlotButtons)
            {
                abtnRemoveSlot = new Button[slots];
                for (int iSlot = 0; iSlot < slots; iSlot++)
                    abtnRemoveSlot[iSlot] = new Button();
            }

            // FlowLayoutStrategy
            flowLayoutStrategy.Parent     = this;
            flowLayoutStrategy.AutoScroll = false;

            //VScrollBarStrategy
            VScrollBarStrategy.Parent  = this;
            VScrollBarStrategy.TabStop = true;
            VScrollBarStrategy.Scroll += new ScrollEventHandler(VScrollBarStrategy_Scroll);

            if (bShowAddSlotButtons)
            {
                // btnAddOpenFilter
                btnAddOpenFilter = new Button();
                btnAddOpenFilter.Tag       = strategy.OpenSlot;
                btnAddOpenFilter.Text      = Language.T("Add an Opening Logic Condition");
                btnAddOpenFilter.Margin    = new Padding(30, 0, 0, space);
                btnAddOpenFilter.UseVisualStyleBackColor = true;
                toolTip.SetToolTip(btnAddOpenFilter, Language.T("Add a new entry logic slot to the strategy."));

                // btnAddCloseFilter
                btnAddCloseFilter = new Button();
                btnAddCloseFilter.Tag       = strategy.CloseSlot;
                btnAddCloseFilter.Text      = Language.T("Add a Closing Logic Condition");
                btnAddCloseFilter.Margin    = new Padding(30, 0, 0, space);
                btnAddCloseFilter.UseVisualStyleBackColor = true;
                toolTip.SetToolTip(btnAddCloseFilter, Language.T("Add a new exit logic slot to the strategy."));

                // btnClosingFilterHelp
                btnClosingFilterHelp = new Button();
                btnClosingFilterHelp.Image   = Properties.Resources.info;
                btnClosingFilterHelp.Margin  = new Padding(2, 2, 0, space);
                btnClosingFilterHelp.TabStop = false;
                btnClosingFilterHelp.Click  += new EventHandler(BtnClosingFilterHelp_Click);
                btnClosingFilterHelp.UseVisualStyleBackColor = true;
            }

            return;
        }
开发者ID:MerlinBrasil,项目名称:Forex-Strategy-Trader,代码行数:68,代码来源:Strategy+Layout.cs

示例14: StrategyLayout

        /// <summary>
        /// Initializes the strategy field
        /// </summary>
        public StrategyLayout(Strategy strategy)
        {
            _strategy = strategy;
            _slots = strategy.Slots;
            _slotMinMidMax = SlotSizeMinMidMax.Mid;
            _toolTip = new ToolTip();
            _flowLayoutStrategy = new FlowLayoutPanel();
            _vScrollBarStrategy = new VScrollBar();
            ApnlSlot = new Panel[_slots];
            PnlProperties = new Panel();

            for (int iSlot = 0; iSlot < _slots; iSlot++)
                ApnlSlot[iSlot] = new Panel();

            AbtnRemoveSlot = new Button[_slots];
            for (int iSlot = 0; iSlot < _slots; iSlot++)
                AbtnRemoveSlot[iSlot] = new Button();

            // FlowLayoutStrategy
            _flowLayoutStrategy.Parent = this;
            _flowLayoutStrategy.AutoScroll = false;

            //VScrollBarStrategy
            _vScrollBarStrategy.Parent = this;
            _vScrollBarStrategy.TabStop = true;
            _vScrollBarStrategy.Scroll += VScrollBarStrategyScroll;

            // btnAddOpenFilter
            BtnAddOpenFilter = new Button
                                   {
                                       Tag = strategy.OpenSlot,
                                       Text = Language.T("Add an Opening Logic Condition"),
                                       Margin = new Padding(30, 0, 0, Space),
                                       UseVisualStyleBackColor = true
                                   };
            _toolTip.SetToolTip(BtnAddOpenFilter, Language.T("Add a new entry logic slot to the strategy."));

            // btnAddCloseFilter
            BtnAddCloseFilter = new Button
                                    {
                                        Tag = strategy.CloseSlot,
                                        Text = Language.T("Add a Closing Logic Condition"),
                                        Margin = new Padding(30, 0, 0, Space),
                                        UseVisualStyleBackColor = true
                                    };
            _toolTip.SetToolTip(BtnAddCloseFilter, Language.T("Add a new exit logic slot to the strategy."));

            // btnClosingFilterHelp
            _btnClosingFilterHelp = new Button
                                        {
                                            Image = Resources.info,
                                            Margin = new Padding(2, 2, 0, Space),
                                            TabStop = false
                                        };
            _btnClosingFilterHelp.Click += BtnClosingFilterHelp_Click;
            _btnClosingFilterHelp.UseVisualStyleBackColor = true;
        }
开发者ID:kalaytan,项目名称:Forex-Strategy-Trader,代码行数:60,代码来源:StrategyLayout.cs

示例15: ScaleChildControl_VScrollBarTest

        public void ScaleChildControl_VScrollBarTest()
        {
            using (var scrollBar = new VScrollBar { Width = 20, Height = 200 })
            {
                OTBaseForm.ScaleChildControl(scrollBar, new SizeF(2.0f, 2.0f));

                Assert.Equal(40, scrollBar.Width);
            }
        }
开发者ID:urusupa,项目名称:OpenTween,代码行数:9,代码来源:OTBaseFormTest.cs


注:本文中的System.Windows.Forms.VScrollBar类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。