本文整理汇总了C#中System.Windows.Forms.HScrollBar类的典型用法代码示例。如果您正苦于以下问题:C# HScrollBar类的具体用法?C# HScrollBar怎么用?C# HScrollBar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HScrollBar类属于System.Windows.Forms命名空间,在下文中一共展示了HScrollBar类的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();
}
示例2: 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;
}
示例3: ResizeToRectangle
override public void ResizeToRectangle(HScrollBar hBar)
{
hBar.LargeChange = m_Bounds.Width;
hBar.Maximum = 1024;
SetDisplayWindow(hBar.Value, 1024);
}
示例4: 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);
}
示例5: 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();
}
示例6: TrackEditor
public TrackEditor()
{
if (!DesignMode)
{
this.DoubleBuffered = true;
this.PlaybackPosition = 0;
this.InPlayback = false;
IsMouseOver = false;
ShowNotesGrid = false;
GridScalar = 0.25;
CurrentSelectionState = EditorSelectionState.Idle;
Control.CheckForIllegalCrossThreadCalls = true;
CopyChords = new CopyChordList(this);
HScroll = new HScrollBar();
HScroll.Dock = System.Windows.Forms.DockStyle.Bottom;
HScroll.SmallChange = Utility.HScrollSmallChange;
HScroll.LargeChange = Utility.HScrollLargeChange;
this.Controls.Add(HScroll);
}
}
示例7: DataGridViewSummary
public DataGridViewSummary()
{
InitializeComponent();
refBox = new TextBox();
panel = new Panel();
spacePanel = new Panel();
hScrollBar = new HScrollBar();
summaryControl = new SummaryControlContainer(this);
summaryControl.VisibilityChanged += new EventHandler(summaryControl_VisibilityChanged);
Resize += new EventHandler(DataGridControlSum_Resize);
RowHeadersWidthChanged += new EventHandler(DataGridControlSum_Resize);
ColumnAdded += new DataGridViewColumnEventHandler(DataGridControlSum_ColumnAdded);
ColumnRemoved += new DataGridViewColumnEventHandler(DataGridControlSum_ColumnRemoved);
hScrollBar.Scroll += new ScrollEventHandler(hScrollBar_Scroll);
hScrollBar.VisibleChanged += new EventHandler(hScrollBar_VisibleChanged);
hScrollBar.Top += summaryControl.Bottom;
hScrollBar.Minimum = 0;
hScrollBar.Maximum = 0;
hScrollBar.Value = 0;
}
示例8: Sygnal
public Sygnal(HScrollBar scrollBar, TrackBar zoomTrackBar, PictureBox pictureBoxSygnal, int dlugoscKanalu)
{
this.scrollBar = scrollBar;
this.zoomTrackBar = zoomTrackBar;
this.pictureBoxSygnal = pictureBoxSygnal;
this.dlugoscKanalu = dlugoscKanalu;
graphicsSygnal = Graphics.FromHwnd(pictureBoxSygnal.Handle);
UstawMaksZoom();
UstawMaksINowaWartoscScroll();
dlugoscSygnalu = ObliczDlugoscSygnalu();
iloscPikseliNaProbke = ObliczIloscPikseliNaProbke();
}
示例9: AutoCompleteTagger
public AutoCompleteTagger()
{
asKeyWords = new string[0];
sbHorz = new HScrollBar();
sbHorz.Scroll += sbHorz_Scroll;
sbHorz.Height = 14;
sbHorz.Hide();
lbSuggest = new ListBox();
lbSuggest.MouseUp += lbSuggest_MouseUp;
lbSuggest.MouseMove += lbSuggest_MouseMove;
lbSuggest.VisibleChanged += lbSuggest_VisibleChanged;
lbSuggest.Hide();
}
示例10: InitializeComponent
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RdlViewer));
this._RunButton = new System.Windows.Forms.Button();
this._hScroll = new System.Windows.Forms.HScrollBar();
this._vScroll = new System.Windows.Forms.VScrollBar();
this._DrawPanel = new fyiReporting.RdlViewer.PageDrawing();
this.SuspendLayout();
//
// _RunButton
//
resources.ApplyResources(this._RunButton, "_RunButton");
this._RunButton.Name = "_RunButton";
this._RunButton.UseVisualStyleBackColor = true;
this._RunButton.Click += new System.EventHandler(this.ParametersViewClick);
//
// _hScroll
//
resources.ApplyResources(this._hScroll, "_hScroll");
this._hScroll.Name = "_hScroll";
this._hScroll.Scroll += new System.Windows.Forms.ScrollEventHandler(this.HorizontalScroll);
//
// _vScroll
//
resources.ApplyResources(this._vScroll, "_vScroll");
this._vScroll.Name = "_vScroll";
this._vScroll.Scroll += new System.Windows.Forms.ScrollEventHandler(this.VerticalScroll);
//
// _DrawPanel
//
resources.ApplyResources(this._DrawPanel, "_DrawPanel");
this._DrawPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this._DrawPanel.Name = "_DrawPanel";
this._DrawPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.DrawPanelPaint);
this._DrawPanel.KeyDown += new System.Windows.Forms.KeyEventHandler(this.DrawPanelKeyDown);
this._DrawPanel.Resize += new System.EventHandler(this.DrawPanelResize);
//
// RdlViewer
//
resources.ApplyResources(this, "$this");
this.Controls.Add(this._vScroll);
this.Controls.Add(this._hScroll);
this.Controls.Add(this._RunButton);
this.Controls.Add(this._DrawPanel);
this.Name = "RdlViewer";
this.ResumeLayout(false);
}
示例11: SimulationPanel
public SimulationPanel(MainForm mainform)
{
DoubleBuffered = true;
Draw = true;
this.mainform = mainform;
hscrollbar = new HScrollBar {Dock = DockStyle.Bottom, Enabled = false};
hscrollbar.Scroll += hscroll;
hscrollbar.Visible = true;
vscrollbar = new VScrollBar {Dock = DockStyle.Right, Enabled = false};
vscrollbar.Scroll += vscroll;
vscrollbar.Visible = true;
Controls.Add(hscrollbar);
Controls.Add(vscrollbar);
}
示例12: ScrollbarAdapter
/// <summary>
/// Constructor</summary>
/// <param name="transformAdapter">Transform adapter</param>
/// <param name="canvasAdapter">Canvas adapter</param>
public ScrollbarAdapter(ITransformAdapter transformAdapter, ICanvasAdapter canvasAdapter)
{
m_transformAdapter = transformAdapter;
m_transformAdapter.TransformChanged += transformAdapter_TransformChanged;
m_canvasAdapter = canvasAdapter;
m_canvasAdapter.BoundsChanged += canvasAdapter_BoundsChanged;
m_canvasAdapter.WindowBoundsChanged += canvasAdapter_WindowBoundsChanged;
m_vScrollBar = new VScrollBar();
m_vScrollBar.Dock = DockStyle.Right;
m_vScrollBar.ValueChanged += vScrollBar_ValueChanged;
m_hScrollBar = new HScrollBar();
m_hScrollBar.Dock = DockStyle.Bottom;
m_hScrollBar.ValueChanged += hScrollBar_ValueChanged;
}
示例13: MapController
/**************************************************/
/* constructors */
/**************************************************/
public MapController()
{
c_hscroll = new HScrollBar();
c_hscroll.ValueChanged += new EventHandler(c_hscroll_ValueChanged);
c_vscroll = new VScrollBar();
c_vscroll.ValueChanged += new EventHandler(c_vscroll_ValueChanged);
c_viewer = new mapView();
c_viewer.SetScrollBars(c_vscroll,c_hscroll);
c_viewer.Size = Size;
c_viewer.Location = new Point(0,0);
Controls.Add(c_viewer);
Controls.Add(c_hscroll);
Controls.Add(c_vscroll);
}
示例14: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.hScrollBar = new System.Windows.Forms.HScrollBar();
this.vScrollBar = new System.Windows.Forms.VScrollBar();
this.NuGenTBase = new NuGenTBase();
this.SuspendLayout();
//
// hScrollBar
//
this.hScrollBar.Dock = System.Windows.Forms.DockStyle.Bottom;
this.hScrollBar.Location = new System.Drawing.Point(0, 159);
this.hScrollBar.Name = "hScrollBar";
this.hScrollBar.Size = new System.Drawing.Size(248, 17);
this.hScrollBar.TabIndex = 0;
this.hScrollBar.ValueChanged += new System.EventHandler(this.hScrollBar_ValueChanged);
//
// vScrollBar
//
this.vScrollBar.Dock = System.Windows.Forms.DockStyle.Right;
this.vScrollBar.Location = new System.Drawing.Point(231, 0);
this.vScrollBar.Name = "vScrollBar";
this.vScrollBar.Size = new System.Drawing.Size(17, 159);
this.vScrollBar.TabIndex = 1;
this.vScrollBar.ValueChanged += new System.EventHandler(this.vScrollBar_ValueChanged);
//
// NuGenTBase
//
this.NuGenTBase.Dock = System.Windows.Forms.DockStyle.Fill;
this.NuGenTBase.Location = new System.Drawing.Point(0, 0);
this.NuGenTBase.Name = "NuGenTBase";
this.NuGenTBase.Size = new System.Drawing.Size(231, 159);
this.NuGenTBase.TabIndex = 2;
this.NuGenTBase.KeyUp += new System.Windows.Forms.KeyEventHandler(this.NuGenTBase_KeyUp);
this.NuGenTBase.KeyDown += new System.Windows.Forms.KeyEventHandler(this.NuGenTBase_KeyDown);
this.NuGenTBase.MouseDown += new System.Windows.Forms.MouseEventHandler(this.NuGenTBase_MouseDown);
//
// NuGenTViewCtrl
//
this.Controls.Add(this.NuGenTBase);
this.Controls.Add(this.vScrollBar);
this.Controls.Add(this.hScrollBar);
this.Name = "NuGenTViewCtrl";
this.Size = new System.Drawing.Size(248, 176);
this.ResumeLayout(false);
}
示例15: InitializeComponent
private void InitializeComponent()
{
scrVertical = new VScrollBar();
scrHorizontal = new HScrollBar();
lblCorner = new Label();
SuspendLayout();
//
// scrVertical
//
scrVertical.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom)
| AnchorStyles.Right;
scrVertical.Location = new Point(170, 0);
scrVertical.Name = "scrVertical";
scrVertical.Size = new Size(17, 411);
scrVertical.TabIndex = 0;
scrVertical.Scroll += scrVertical_Scroll;
//
// scrHorizontal
//
scrHorizontal.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left)
| AnchorStyles.Right;
scrHorizontal.Location = new Point(0, 411);
scrHorizontal.Name = "scrHorizontal";
scrHorizontal.Size = new Size(169, 17);
scrHorizontal.TabIndex = 1;
scrHorizontal.Scroll += scrHorizontal_Scroll;
//
// lblCorner
//
lblCorner.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
lblCorner.Location = new Point(169, 411);
lblCorner.AutoSize = false;
lblCorner.Text = null;
lblCorner.Size = new Size(18, 17);
lblCorner.BackColor = SystemColors.Control;
//
// ScrollingControl
//
Controls.Add(scrHorizontal);
Controls.Add(scrVertical);
Controls.Add(lblCorner);
Name = "ScrollingControl";
Size = new Size(187, 428);
ResumeLayout(false);
}