Class ScrollControl
Defines a base class for custom controls that support scrolling behavior.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms
Assembly: Syncfusion.Shared.Base.dll
Syntax
public class ScrollControl : BaseControl, IThemeProvider, IDisposable, IVisualStyle, ICancelModeProvider, ISplitterPaneSupport, IScrollBarWrapperContainer, ISupportUpdating, ISupportIntelliMouse, IQueryFocusInside, INonClientPaintingSupport
Remarks
The ScrollControl class acts as a base class for controls that require the ability to scroll. To allow a control to display scrollbars as needed, set the AutoScroll property to True. To select which scrollbars should be visible, set the VScroll and HScroll properties.
You can also associate stand-alone scrollbars with the ScrollControl. The VertScrollBar and HorizScrollBar properties allow you to associate external scrollbars. This is of benefit if you want to share one scrollbar with a parent control. For example, if the ScrollControl is a view inside a workbook or dynamic splitter frame.
ScrollControl supports automatic scrolling when the user drags the mouse. In a grid when the user starts selecting cells the user can drag the mouse outside the grid area and the grid will automatically scroll. To enable auto scrolling, override the OnMouseDown event in your derived control and initialize the AutoScrolling, AutoScrollBounds and InsideScrollBounds properties.
When the user scrolls your control and holds down the mouse on the down or up arrow of the scrollbar, the scrolling speed will accelerate.
The FixRenderOrigin method will ensure correct initialization of the rendering origin for brushes and patterns. You can call FixRenderOrigin from your control's OnPaint method. ScrollControl supports scrolling with the mouse wheel and also cooperates fine with with the IntelliMouseDragScroll class.
If you want to provide context information about your control and change the cursor on the fly while the user moves the mouse, set the OverrideCursor property to the cursor you want to show. Instead, you can also implement IMouseController and add the object to MouseControllerDispatcher.
Constructors
ScrollControl()
Initializes a new instance of ScrollControl.
Declaration
public ScrollControl()
Fields
IgnoreSizeGripStyleHideShow
The SizeGripStyle behavior has been changed after version 6.1. For old behavior set this to true. Default value is false.
Declaration
public static bool IgnoreSizeGripStyleHideShow
Field Value
Type |
---|
System.Boolean |
Properties
AccelerateScrolling
Gets or sets the acceleration behavior for scrollbars.
Declaration
public AccelerateScrollingBehavior AccelerateScrolling { get; set; }
Property Value
Type |
---|
AccelerateScrollingBehavior |
ActiveController
Returns a reference to the active mouse controller that is receiving MouseDown, MouseMove, MouseUp messages when the user has pressed a mouse button.
Declaration
public IMouseController ActiveController { get; }
Property Value
Type |
---|
IMouseController |
See Also
AllowIncreaseSmallChange
Indicates whether the scroll control can increase the System.Windows.Forms.ScrollBar.SmallChange property while doing accelerated scrolling. If this is True, the System.Windows.Forms.ScrollBar.SmallChange will be set to 3 after 40 rows and to 5 after 80 rows.
Declaration
public virtual bool AllowIncreaseSmallChange { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
By default the scroll control will increase the scrolling step after a while. Set this to False if you want to enforce scrolling only one row at a time even with accelerated scrolling.
AllowRaiseMouseMoveInOnDragOver
Indicates whether OnMouseMove should be called from OnDragOver.
Declaration
public bool AllowRaiseMouseMoveInOnDragOver { get; set; }
Property Value
Type |
---|
System.Boolean |
AllowSizeGrip
Indicates whether a size grip can be drawn inside the SizeBox and if the System.Windows.Forms.Form.SizeGripStyle of the parent form is allowed to be changed.
Declaration
public bool AllowSizeGrip { get; set; }
Property Value
Type |
---|
System.Boolean |
AutoScrollBounds
Gets or sets the outer scrolling area. Typically the client area of the control.
Declaration
public Rectangle AutoScrollBounds { get; set; }
Property Value
Type |
---|
System.Drawing.Rectangle |
AutoScrolling
Disables or specifies the direction for automatic scrolling when the user drags the mouse cursor out of the scrolling area.
Declaration
public ScrollBars AutoScrolling { get; set; }
Property Value
Type |
---|
System.Windows.Forms.ScrollBars |
AutoScrollTimerEnable
Indicates whether the control is currently scrolling and the user drags the mouse outside the inner scrolling area.
Declaration
public bool AutoScrollTimerEnable { get; }
Property Value
Type |
---|
System.Boolean |
BorderStyle
Gets / sets the border style of the control.
Declaration
public BorderStyle BorderStyle { get; set; }
Property Value
Type |
---|
System.Windows.Forms.BorderStyle |
Bounds
Gets or sets the control's bounds. Size is overridden here to prevent Code Generation in Designer.
Declaration
public Rectangle Bounds { get; set; }
Property Value
Type |
---|
System.Drawing.Rectangle |
ClientRectangle
Gets the rectangle that represents the client area of the control. If custom scroll bars (ScrollBarCustomDraw, Office2007 style) are shown in the client area, then this method will remove the area occupied by the scrollbars.
Declaration
public Rectangle ClientRectangle { get; }
Property Value
Type |
---|
System.Drawing.Rectangle |
ClientSize
Gets or sets the height and width of the client area of the control. If custom scroll bars (ScrollBarCustomDraw, Office2007 style) are shown the client area, then this method will remove the area occupied by the scrollbars.
Declaration
public Size ClientSize { get; set; }
Property Value
Type |
---|
System.Drawing.Size |
CreateParams
Overridden. Changes System.Windows.Forms.CreateParams.Style to show or hide scrollbars and also consider the control's BorderStyle setting.
Declaration
protected override CreateParams CreateParams { get; }
Property Value
Type |
---|
System.Windows.Forms.CreateParams |
Cursor
Gets / sets the cursor that is displayed when the mouse pointer is over the control.
Declaration
public override Cursor Cursor { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.Cursor | A System.Windows.Forms.Cursor object. |
DisableScrollWindow
Lets you check or specify the setting if the window should be scrolled when ScrollWindow is called.
Declaration
public bool DisableScrollWindow { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
If DisableScrollWindow is True, any calls to the ScrollWindow method will simply invalidate the affect region. The rendering origin will still be recorded correctly and WindowScrolling and WindowScrolled events will be raised.
If DisableScrollWindow is False, the ScrollWindow will scroll the contents of the control.
DisableScrollWindow will return True if BeginUpdate was called without the BeginUpdateOptions.ScrollWindow option.
See Also
DiscardPaintMessagesAfterBeginUpdate
When you call BeginUpdate(), the control by default does not handle WM_PAINT messages. Only once you call EndUpdate they will be processed. If this causes problems in your application, you can set this static property to True. In such cases, WM_PAINT messages will be simply discarded and any invalid regions will be validated.
Declaration
public static bool DiscardPaintMessagesAfterBeginUpdate { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
There is a problem with the default implementation of BeginUpdate. If a screen region is marked invalid, the WndProc will be repeatedly called with WM_PAINT at the the top of the WndProc until EndUpdate is called. This can cause your application to freeze if another window gets created or if you make a web service call and WndProc messages need to be processed.
Setting DiscardPaintMessagesAfterBeginUpdate to True will help avoid these scenarios.
DoubleBufferSurface
Returns the DoubleBufferSurface if EnableDoubleBufferSurface() was called. Otherwise the method returns null.
Declaration
public DoubleBufferSurface DoubleBufferSurface { get; }
Property Value
Type |
---|
DoubleBufferSurface |
DpiAware
Gets or sets the boolean value for enhanching the apperance settings for DpiAware enabled Application.
Declaration
public bool DpiAware { get; set; }
Property Value
Type |
---|
System.Boolean |
EnableIntelliMouse
Toggles support for Intelli-Mouse panning. When the user presses the middle mouse button and drags the mouse, the window will scroll.
Declaration
public bool EnableIntelliMouse { get; set; }
Property Value
Type |
---|
System.Boolean |
EnableTouchMode
Gets or sets the touch mode.
Declaration
public virtual bool EnableTouchMode { get; set; }
Property Value
Type |
---|
System.Boolean |
FillSplitterPane
Toggles support for using the control inside a dynamic splitter window and sharing scrollbars with the parent window.
Declaration
public bool FillSplitterPane { get; set; }
Property Value
Type |
---|
System.Boolean |
ForceSizeBox
Indicates whether the size box should always be drawn when both scrollbars are visible. This property differs from SmartSizeBox such that the control will not check the docking state and parent form to determine whether to show the size box. Note: Another better solution is drawing NonClientArea ourselves. See SizeGripStyle which implements this newer solution.
Declaration
public bool ForceSizeBox { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
Showing the size box works around a problem with .NET controls because by default the area at the bottom right is not drawn and that can cause drawing glitches. Note: Another better solution is drawing the NonClientArea ourselves. See SizeGripStyle which implements this newer solution.
GridOfficeScrollBars
Gets or sets the Office like scrollbars.
Declaration
public virtual OfficeScrollBars GridOfficeScrollBars { get; set; }
Property Value
Type |
---|
OfficeScrollBars |
HasControlFocus
Indicates whether OnControlGotFocus() has been called. OnControlLostFocus() resets this flag.
Declaration
public bool HasControlFocus { get; }
Property Value
Type |
---|
System.Boolean |
HasDoubleBufferSurface
Determines if EnableDoubleBufferSurface method was called and double buffering using the DoubleBufferSurface is enabled. The DoubleBufferSurface buffering is different from the automatic .NET double buffering and also a bit slower but it reduces flicker if lots of scrolling is used and gdi drawing for individual cells in a grid.
Declaration
public bool HasDoubleBufferSurface { get; }
Property Value
Type |
---|
System.Boolean |
HorizontalScrollTips
Indicates whether the control should show ScrollTips while the user is dragging a horizontal scrollbar thumb.
Declaration
public virtual bool HorizontalScrollTips { get; set; }
Property Value
Type |
---|
System.Boolean |
HorizontalThumbTrack
Indicates whether the control should scroll while the user is dragging a horizontal scrollbar thumb.
Declaration
public virtual bool HorizontalThumbTrack { get; set; }
Property Value
Type |
---|
System.Boolean |
HScroll
Indicates whether the horizontal scroll bar is visible.
Declaration
public bool HScroll { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | langword_csharp_True if the horizontal scroll bar is visible; langword_csharp_False otherwise. |
See Also
HScrollBar
Returns a reference to an object with horizontal scrollbar settings of the control.
Declaration
public ScrollBarWrapper HScrollBar { get; }
Property Value
Type |
---|
ScrollBarWrapper |
HScrollIncrement
Gets or sets the multiplier for mouse wheel scrolling.
Declaration
public virtual int HScrollIncrement { get; set; }
Property Value
Type |
---|
System.Int32 |
IgnoreUICues
ScrollControlMouseController checks this to see if it should cancel existing mouse operation and call ScrollControlMouseController.CancelMode when a UICuesChanged event is sent. That can happen when user activates another application or simply when styles for a child window have changed.
Declaration
public bool IgnoreUICues { get; set; }
Property Value
Type |
---|
System.Boolean |
InsideScrollBounds
Returns the inside scrolling area. The control will scroll if the user drags the mouse outside this area.
Declaration
public virtual Rectangle InsideScrollBounds { get; }
Property Value
Type |
---|
System.Drawing.Rectangle |
InsideScrollMargins
Gets or sets the default margins for the scrolling area when the user moves the mouse to the margin between InsideScrollBounds and AutoScrollBounds.
Declaration
public Size InsideScrollMargins { get; set; }
Property Value
Type |
---|
System.Drawing.Size |
IsActiveControl
Indicates whether OnEnter(EventArgs) has been called. OnLeave(EventArgs) resets this flag.
Declaration
public bool IsActiveControl { get; }
Property Value
Type |
---|
System.Boolean |
IsDeactivated
Indicates whether OnDeactivated(EventArgs) has been called. OnEnter(EventArgs) resets this flag.
Declaration
public bool IsDeactivated { get; }
Property Value
Type |
---|
System.Boolean |
IsDisposing
Returns true if object is executing Dispose(Boolean) method call.
Declaration
public bool IsDisposing { get; }
Property Value
Type |
---|
System.Boolean |
IsMousePressed
Indicates whether the control is handling a System.Windows.Forms.Control.MouseDown event.
Declaration
public bool IsMousePressed { get; set; }
Property Value
Type |
---|
System.Boolean |
IsSplitterPaneClosed
Indicates whether the splitter control has closed the pane with this control.
Declaration
public bool IsSplitterPaneClosed { get; }
Property Value
Type |
---|
System.Boolean |
IsSplitterPaneClosing
Indicates whether the splitter control is closing the pane with this control.
Declaration
public bool IsSplitterPaneClosing { get; }
Property Value
Type |
---|
System.Boolean |
IsValidated
Indicates whether the OnValidated(EventArgs) method has been called. OnLeave(EventArgs) and OnEnter(EventArgs) resets this flag.
Declaration
public bool IsValidated { get; }
Property Value
Type |
---|
System.Boolean |
IsValidating
Indicates whether the OnValidating(CancelEventArgs) method has been called. OnLeave(EventArgs) and OnEnter(EventArgs) resets this flag.
Declaration
public bool IsValidating { get; }
Property Value
Type |
---|
System.Boolean |
LastMousePosition
Property MousePosition (Point) - cached Control.MousePosition. The variable is set before any WM_MOUSE* messages being processed.
Declaration
public Point LastMousePosition { get; set; }
Property Value
Type |
---|
System.Drawing.Point |
MetroColorTable
Declaration
public virtual MetroColorTable MetroColorTable { get; set; }
Property Value
Type |
---|
MetroColorTable |
MetroScrollBars
Declaration
public virtual bool MetroScrollBars { get; set; }
Property Value
Type |
---|
System.Boolean |
MouseControllerDispatcher
MouseControllerDispatcher coordinates mouse events among competing mouse controllers. Based on the position of the mouse and context of the control every registered controller's HitTest method is called to determine the best controller for the following mouse action. This controller will then receive mouse events.
Declaration
public MouseControllerDispatcher MouseControllerDispatcher { get; }
Property Value
Type |
---|
MouseControllerDispatcher |
Remarks
See MouseControllerDispatcher for more information.
MouseWheelScrollLines
Lets you override the scroll behavior for rolling the mouse wheel. Default is SystemInformation.MouseWheelScrollLines.
Declaration
public int MouseWheelScrollLines { get; set; }
Property Value
Type |
---|
System.Int32 |
Office2007ScrollBars
Toggles between standard and Office2007 scrollbars.
Declaration
public virtual bool Office2007ScrollBars { get; set; }
Property Value
Type |
---|
System.Boolean |
Office2007ScrollBarsColorScheme
Gets or sets the style of Office2007 scroll bars.
Declaration
public virtual Office2007ColorScheme Office2007ScrollBarsColorScheme { get; set; }
Property Value
Type |
---|
Office2007ColorScheme |
Office2010ScrollBarsColorScheme
Gets or sets the style of MS Office2010 scroll bars.
Declaration
public virtual Office2010ColorScheme Office2010ScrollBarsColorScheme { get; set; }
Property Value
Type |
---|
Office2010ColorScheme |
Office2016BlackColorTable
Gets or sets the color table for Office2016 Black theme scrollbar.
Declaration
public virtual MetroColorTable Office2016BlackColorTable { get; set; }
Property Value
Type |
---|
MetroColorTable |
Office2016ColorfulColorTable
Gets or sets the color table for Office2016 colorful theme scrollbar.
Declaration
public virtual MetroColorTable Office2016ColorfulColorTable { get; set; }
Property Value
Type |
---|
MetroColorTable |
Office2016DarkGrayColorTable
Gets or sets the color table for Office2016 Dark gray theme scrollbar.
Declaration
public virtual MetroColorTable Office2016DarkGrayColorTable { get; set; }
Property Value
Type |
---|
MetroColorTable |
Office2016ScrollBars
Gets or sets the Office2016 Scrollbars
Declaration
public virtual bool Office2016ScrollBars { get; set; }
Property Value
Type |
---|
System.Boolean |
Office2016ScrollBarsColorScheme
Gets or sets the style of Office2016 theme for scrollbars.
Declaration
public virtual ScrollBarOffice2016ColorScheme Office2016ScrollBarsColorScheme { get; set; }
Property Value
Type |
---|
ScrollBarOffice2016ColorScheme |
Remarks
This is applicable for both the horizontal and vertical scrollbar.
Office2016WhiteColorTable
Gets or sets the color table for Office2016 white theme scrollbar.
Declaration
public virtual MetroColorTable Office2016WhiteColorTable { get; set; }
Property Value
Type |
---|
MetroColorTable |
PaintPending
Indicates whether there are updates pending for the control when painting is suspended by BeginUpdate.
Declaration
public bool PaintPending { get; }
Property Value
Type |
---|
System.Boolean |
PaneDesc
Returns the Pane information.
Declaration
public virtual string PaneDesc { get; }
Property Value
Type |
---|
System.String |
PreJitPaint
Indicates whether the time the first time the control is drawn should be optimized by calling OnPaint before the control is made visible and so that all relevant code for drawing has been jitted (Just in Time)
Declaration
protected bool PreJitPaint { get; set; }
Property Value
Type |
---|
System.Boolean |
ScrollTip
Returns a reference to the ScrollTipWindow for this control. Can be NULL.
Declaration
public ScrollTipWindow ScrollTip { get; }
Property Value
Type |
---|
ScrollTipWindow |
ScrollTipFormat
Gets or sets the text to be displayed in the ScrollTip window with a place holder for scroll position . For example, " Position {0} "
Declaration
public string ScrollTipFormat { get; set; }
Property Value
Type |
---|
System.String |
Size
Gets or sets the control's size. Size is overridden here to prevent Code Generation in Designer.
Declaration
public Size Size { get; set; }
Property Value
Type |
---|
System.Drawing.Size |
SizeGripStyle
Gets or sets a size grip that should be drawn at the bottom-right corner if both scrollbars are visible.
Declaration
public SizeGripStyle SizeGripStyle { get; set; }
Property Value
Type |
---|
System.Windows.Forms.SizeGripStyle |
SmartSizeBox
Indicates whether the size box should be drawn when both scrollbars are visible and the control is not a docked window in an MDIChild window. Note: Another better solution is drawing the NonClientArea ourselves. See SizeGripStyle which implements this newer solution.
Declaration
public bool SmartSizeBox { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
Showing the size box works around a problem with .NET controls because by default the the area at the bottom right is not drawn and that can cause drawing glitches. Note: Another better solution is drawing NonClientArea ourselves. See SizeGripStyle which implements this newer solution.
SmoothMouseWheelScrolling
Indicates whether the control should perform one scroll command (faster) or if it should perform multiple scroll commands with smaller increments (smoother) when user rolls mouse wheel.
Declaration
public bool SmoothMouseWheelScrolling { get; set; }
Property Value
Type |
---|
System.Boolean |
SupportsThumbTrack
Indicates whether the control should scroll while the user is dragging a scrollbar thumb.
Declaration
[Obsolete("Use VerticalThumbTrack and HorizontalThumbTrack properties instead.")]
public bool SupportsThumbTrack { get; set; }
Property Value
Type |
---|
System.Boolean |
TabIndex
Gets or sets the TabIndex. TabIndex is overridden here to prevent Code Generation in Designer.
Declaration
public int TabIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
ThemeStyle
Gets or sets a style of the ScrollControl components.
Declaration
public ScrollerVisualStyle ThemeStyle { get; set; }
Property Value
Type |
---|
ScrollerVisualStyle |
UpdateOptions
Returns the settings for the current BeginUpdate option.
Declaration
public virtual BeginUpdateOptions UpdateOptions { get; }
Property Value
Type |
---|
BeginUpdateOptions |
Updating
Indicates whether BeginUpdate() has been called and the painting for a control is suspended.
Declaration
public bool Updating { get; }
Property Value
Type |
---|
System.Boolean |
UpdatingStyles
Indicates whether System.Windows.Forms.Control.UpdateStyles is internally called.
Declaration
protected bool UpdatingStyles { get; }
Property Value
Type |
---|
System.Boolean |
UseSharedScrollBars
Enables shared scrollbars. Use this if the control is not embedded in a container control that implements IScrollBarFrame and you want to provide your own scrollbars.
Declaration
public bool UseSharedScrollBars { get; set; }
Property Value
Type |
---|
System.Boolean |
VerticalScrollTips
Indicates whether the control should show ScrollTips while the user is dragging a vertical scrollbar thumb.
Declaration
public virtual bool VerticalScrollTips { get; set; }
Property Value
Type |
---|
System.Boolean |
VerticalThumbTrack
Indicates whether the control should scroll while the user is dragging a vertical scrollbar thumb.
Declaration
public virtual bool VerticalThumbTrack { get; set; }
Property Value
Type |
---|
System.Boolean |
VScroll
Indicates whether the vertical scroll bar is visible.
Declaration
public bool VScroll { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | langword_csharp_True if the vertical scroll bar is visible; langword_csharp_False otherwise. |
See Also
VScrollBar
Returns a reference to an object with vertical scrollbar settings of the control.
Declaration
public ScrollBarWrapper VScrollBar { get; }
Property Value
Type |
---|
ScrollBarWrapper |
VScrollIncrement
Gets or sets the multiplier for mouse wheel scrolling.
Declaration
public virtual int VScrollIncrement { get; set; }
Property Value
Type |
---|
System.Int32 |
Methods
BeginUpdate()
Suspends the painting of the control until the EndUpdate() method is called.
Declaration
public void BeginUpdate()
Remarks
When many paints are made to the appearance of a control, you should invoke the BeginUpdate method to temporarily freeze the drawing of the control. This results in less distraction to the user and a performance gain. After all updates have been made, invoke the EndUpdate method to resume drawing of the control.
BeginUpdate(BeginUpdateOptions)
Suspends the painting of the control until the EndUpdate() method is called.
Declaration
public virtual void BeginUpdate(BeginUpdateOptions options)
Parameters
Type | Name | Description |
---|---|---|
BeginUpdateOptions | options | Specifies the painting support during the BeginUpdate, EndUpdate batch. |
Remarks
When many paints are made to the appearance of a control, you should invoke the BeginUpdate method to temporarily freeze the drawing of the control. This results in less distraction to the user and a performance gain. After all updates have been made, invoke the EndUpdate method to resume drawing of the control.
Pass BeginUpdateOptions if you do not want to do a complete Refresh of the control and instead want to have certain regions of your control be invalidated or scroll the contents of control.
If you call BeginUpdate() and then later EndUpdate(), the control will know if a paint is pending and only refresh the control if a paint is pending. Calling ShouldPrepareUpdate, Invalidate or a WM_PAINT message during the BeginUpdate EndUpdate block will signal the control that a paint is pending.See Also
CancelUpdate()
Cancels any prior BeginUpdate() calls.
Declaration
public void CancelUpdate()
See Also
Dispose()
Disposes the control.
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
EnableDoubleBufferSurface()
Enables the DoubleBufferSurface for this control. The DoubleBufferSurface buffering is different from the automatic .NET double buffering and also a bit slower but it reduces flicker if lots of scrolling is used and gdi drawing for individual cells in a grid.
Declaration
public void EnableDoubleBufferSurface()
EndUpdate()
Resumes the painting of the control suspended by calling the BeginUpdate method.
Declaration
public void EndUpdate()
Remarks
When many paints are made to the appearance of a control, you should invoke the BeginUpdate method to temporarily freeze the drawing of the control. This results in less distraction to the user and a performance gain. After all updates have been made, invoke the EndUpdate method to resume drawing of the control.
See Also
EndUpdate(Boolean)
Declaration
public virtual void EndUpdate(bool update)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | update |
EnsurePaintCodeJitted(Boolean)
Checks if the control is visible and a window handle has been created. If it has not been drawn before, it calls OnEnsurePaintCodeJitted().
Declaration
public void EnsurePaintCodeJitted(bool ignoreVisible)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | ignoreVisible | Set this True if you want to force a call to OnEnsurePaintCodeJitted() even if the control is not visible and / or no window handle has been created. |
FixRenderOrigin(Graphics)
Call this method from your control's OnPaint method to ensure correct rendering origin for brushes and patterns.
Declaration
protected void FixRenderOrigin(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The graphics object. |
GetDynamicSplitterFrameOfComponent(Object)
Given a component, this retrieves the IDynamicSplitterFrame that it is parented to; NULL if it is not parented to any IDynamicSplitterFrame.
Declaration
public static IDynamicSplitterFrame GetDynamicSplitterFrameOfComponent(object comp)
Parameters
Type | Name | Description |
---|---|---|
System.Object | comp | The component to check. |
Returns
Type | Description |
---|---|
IDynamicSplitterFrame | An IDynamicSplitterFrame that the component is parented to; NULL if no such interface exists. This will return the component if it is an instance of IDynamicSplitterFrame. |
GetScrollBarFrameOfComponent(Object)
Given a component, this retrieves the IScrollBarFrame that it is parented to; NULL if it is not parented to any IScrollBarFrame.
Declaration
public static IScrollBarFrame GetScrollBarFrameOfComponent(object comp)
Parameters
Type | Name | Description |
---|---|---|
System.Object | comp | The component to check. |
Returns
Type | Description |
---|---|
IScrollBarFrame | A IScrollBarFrame that the component is parented to; NULL if no such interface exists. This will return the component if it is an instance of IScrollBarFrame. |
HitTest(Point)
Returns a value indicating the context at a given mouse position.
Declaration
public int HitTest(Point point)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | point | The mouse position in client coordinates. |
Returns
Type | Description |
---|---|
System.Int32 | A System.Int32 value indicating the context at a given mouse position; zero if no context found. |
Remarks
Any Mouse Controller needs to implement the IMouseController interface.
In its implementation of MouseController.HitTest the mouse controller determines whether it wants to handle the mouse events for the current mouse position.
MouseControllerDispatcher will call HitTest for each Mouse Controller that has been registered with Add(IMouseController). The Mouse Controller that wins the vote will be returned together with the context value its HitTest implementation returned.
See Also
HitTest(Point, MouseButtons)
Returns a value indicating the context at a given mouse position.
Declaration
public int HitTest(Point point, MouseButtons mouseButton)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | point | The mouse position in client coordinates. |
System.Windows.Forms.MouseButtons | mouseButton | Indicates which mouse button was pressed. |
Returns
Type | Description |
---|---|
System.Int32 | A System.Int32 value indicating the context at a given mouse position; 0 if no context found. |
HitTest(Point, MouseButtons, out IMouseController)
Returns a value indicating the context at a given mouse position.
Declaration
public int HitTest(Point point, MouseButtons mouseButton, out IMouseController controller)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | point | The mouse position in client coordinates. |
System.Windows.Forms.MouseButtons | mouseButton | Indicates which mouse button was pressed. |
IMouseController | controller | A place holder where the controller is returned that won the vote. |
Returns
Type | Description |
---|---|
System.Int32 | A System.Int32 value indicating the context at a given mouse position; 0 if no context found. |
HitTest(Point, MouseButtons, Int32, out IMouseController)
Returns a value indicating the context at a given mouse position.
Declaration
public int HitTest(Point point, MouseButtons mouseButton, int clicks, out IMouseController controller)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | point | The mouse position in client coordinates. |
System.Windows.Forms.MouseButtons | mouseButton | Indicates which mouse button was pressed. |
System.Int32 | clicks | Specifies the number of times the mouse button was pressed and released. |
IMouseController | controller | A place holder where the controller is returned that won the vote. |
Returns
Type | Description |
---|---|
System.Int32 | A System.Int32 value indicating the context at a given mouse position; 0 if no context found. |
InvalidateNc()
Method force to invalidate Non Client area of control.
Declaration
protected virtual void InvalidateNc()
InvalidateNc(Rectangle)
Invalidate specified rectangle in Non Client area.
Declaration
protected virtual void InvalidateNc(Rectangle rc)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Rectangle | rc | Rectangle to Invalidate. |
LastMousePositionToClient()
Returns PointToClient(LastMousePosition).
Declaration
public Point LastMousePositionToClient()
Returns
Type |
---|
System.Drawing.Point |
NotifyCancelMode()
Raises a CancelMode event.
Declaration
public void NotifyCancelMode()
OnAccelerateScrollingChanged(EventArgs)
Raises the AccelerateScrollingChanged event.
Declaration
protected virtual void OnAccelerateScrollingChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An System.EventArgs that contains the event data. |
OnAutoScrollingChanged(EventArgs)
Raises the AutoScrollingChanged event.
Declaration
protected virtual void OnAutoScrollingChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An System.EventArgs that contains the event data. |
OnBeginUpdateScrollBars()
Calls BeginUpdate() for both scrollbars.
Declaration
protected virtual void OnBeginUpdateScrollBars()
OnCancelMode(EventArgs)
Raises the CancelMode event.
Declaration
protected virtual void OnCancelMode(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An System.EventArgs that contains the event data. |
OnControlAdded(ControlEventArgs)
Declaration
protected override void OnControlAdded(ControlEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.ControlEventArgs | e |
OnControlGotFocus()
Raises the System.Windows.Forms.Control.GotFocus event. This method is called when the control or any child control gets focus and this control did not have focus before.
Declaration
protected virtual void OnControlGotFocus()
Remarks
Inheriting classes should override this method instead of overriding System.Windows.Forms.Control.OnGotFocus(System.EventArgs) because OnControlGotFocus() is also called when child controls get focus and it is not called when focus is moved within child controls of this control.
OnControlLostFocus()
Raises the System.Windows.Forms.Control.LostFocus event. This method is called when the control or any child control loses focus and the new focused control is not a child of this control.
Declaration
protected virtual void OnControlLostFocus()
Remarks
Inheriting classes should override this method instead of overriding System.Windows.Forms.Control.OnLostFocus(System.EventArgs) because OnControlLostFocus() is also called when child controls lose focus and it is not called when focus is moved within child controls of this control.
OnControlRemoved(ControlEventArgs)
Declaration
protected override void OnControlRemoved(ControlEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.ControlEventArgs | e |
OnCreateScrollTipWindow()
Factory method that creates a ScrollTipWindow for displaying ScrollTips.
Declaration
protected virtual ScrollTipWindow OnCreateScrollTipWindow()
Returns
Type |
---|
ScrollTipWindow |
OnDeactivated(EventArgs)
Raises the Deactivated event.
Declaration
protected virtual void OnDeactivated(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An System.EventArgs that contains the event data. |
OnDragOver(DragEventArgs)
Declaration
protected override void OnDragOver(DragEventArgs drgevent)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.DragEventArgs | drgevent |
OnEndUpdateScrollBars()
Calls EndUpdate() for both scrollbars.
Declaration
protected virtual void OnEndUpdateScrollBars()
OnEnsurePaintCodeJitted()
Minimizes the time the first time the control is drawn. Calling OnPaint before the control is made visible ensures that all relevant code for drawing has been jitted.
Declaration
protected virtual void OnEnsurePaintCodeJitted()
OnEnter(EventArgs)
Declaration
protected override void OnEnter(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnFillSplitterPaneChanged(EventArgs)
Raises the FillSplitterPaneChanged event.
Declaration
protected virtual void OnFillSplitterPaneChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An System.EventArgs that contains the event data. |
OnGotFocus(EventArgs)
Declaration
protected override void OnGotFocus(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnHandleCreated(EventArgs)
Declaration
protected override void OnHandleCreated(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnHorizontalScroll(ScrollEventArgs)
Raises the HorizontalScroll event.
Declaration
protected virtual void OnHorizontalScroll(ScrollEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.ScrollEventArgs | e | A System.Windows.Forms.ScrollEventArgs that contains the event data. |
OnHScroll(Object, ScrollEventArgs)
Listens for the horizontal scrollbar's scroll event.
Declaration
protected virtual void OnHScroll(object sender, ScrollEventArgs se)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | A System.Object that contains data about the control. |
System.Windows.Forms.ScrollEventArgs | se | A System.Windows.Forms.ScrollEventArgs that contains the event data. |
OnHScrollBarValueChanged(Object, EventArgs)
Handles the ValueChanged of the horizontal scrollbar.
Declaration
protected virtual void OnHScrollBarValueChanged(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The source of the event. |
System.EventArgs | e | An System.EventArgs that contains the event data. |
OnIntelliMouseDragScrolling(IntelliMouseDragScrollEventArgs)
Raises the IntelliMouseDragScrolling event.
Declaration
protected virtual void OnIntelliMouseDragScrolling(IntelliMouseDragScrollEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
IntelliMouseDragScrollEventArgs | e |
OnInvalidated(InvalidateEventArgs)
Overridden. See theSystem.Windows.Forms.Control.Invalidated event.
Declaration
protected override void OnInvalidated(InvalidateEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.InvalidateEventArgs | e | An System.Windows.Forms.InvalidateEventArgs that contains the event data. |
OnLeave(EventArgs)
Declaration
protected override void OnLeave(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnLocationChanged(EventArgs)
Declaration
protected override void OnLocationChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnLostFocus(EventArgs)
Declaration
protected override void OnLostFocus(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnMouseDown(MouseEventArgs)
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e |
OnMouseHover(EventArgs)
Declaration
protected override void OnMouseHover(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnMouseLeave(EventArgs)
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnMouseMove(MouseEventArgs)
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e |
OnMouseUp(MouseEventArgs)
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e |
OnMouseWheel(MouseEventArgs)
Handles mouse wheel processing for our scrollbars.
Declaration
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e |
OnMouseWheelZoom(MouseWheelZoomEventArgs)
Override this method to implement zooming in your derived control.
Declaration
protected virtual void OnMouseWheelZoom(MouseWheelZoomEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseWheelZoomEventArgs | e | The event data. |
OnNcCalcSize(ref Rectangle)
Method calculate new client area size. If you want to increase Non-Client area for control and draw on it then this is method especially for you.
Declaration
protected virtual void OnNcCalcSize(ref Rectangle client)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Rectangle | client | Rectangle of the control client area. |
OnNCPaint(NCPaintEventArgs)
Method draws non-client area of an ScrollControl.
Declaration
protected virtual void OnNCPaint(NCPaintEventArgs ncEventArgs)
Parameters
Type | Name | Description |
---|---|---|
NCPaintEventArgs | ncEventArgs | EventArgs with Non-client info for drawing. |
OnOffice2007ScrollBarsChanged(EventArgs)
Raises the Office2007ScrollBarsChanged event.
Declaration
protected virtual void OnOffice2007ScrollBarsChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | A System.EventArgs that contains the event data. |
OnOffice2007ScrollBarsColorSchemeChanged(EventArgs)
Raises the OnOffice2007ScrollBarsColorSchemeChanged(EventArgs) event.
Declaration
protected virtual void OnOffice2007ScrollBarsColorSchemeChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | Event data. |
OnOffice2010ScrollBarsColorSchemeChanged(EventArgs)
Raises the OnOffice2010ScrollBarsColorSchemeChanged(EventArgs) event.
Declaration
protected virtual void OnOffice2010ScrollBarsColorSchemeChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | Event data. |
OnOffice2016ScrollBarsColorSchemeChanged(EventArgs)
Raises the OnOffice2016ScrollBarsColorSchemeChanged(EventArgs) event.
Declaration
protected virtual void OnOffice2016ScrollBarsColorSchemeChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | Event data. |
OnOfficeScrollBarsChanged(ScrollControl.OfficeScrollBarsEventArgs)
Raises the OfficeScrollBarsChanged event
Declaration
protected virtual void OnOfficeScrollBarsChanged(ScrollControl.OfficeScrollBarsEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
ScrollControl.OfficeScrollBarsEventArgs | e | Office scrollbar type |
OnPaint(PaintEventArgs)
Declaration
protected override void OnPaint(PaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e |
OnParentChanged(EventArgs)
Declaration
protected override void OnParentChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnRightToLeftChanged(EventArgs)
Declaration
protected override void OnRightToLeftChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnScrollbarsVisibleChanged(EventArgs)
Fires the ScrollbarsVisibleChanged event.
Declaration
protected virtual void OnScrollbarsVisibleChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | A System.EventArgs that contains the event data. |
OnScrollControlHandledMouseDown(MouseEventArgs)
Raises the ScrollControlHandledMouseDown event.
Declaration
protected virtual void OnScrollControlHandledMouseDown(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e | A System.Windows.Forms.MouseEventArgs that contains the event data. |
OnScrollControlHandledMouseMove(MouseEventArgs)
Raises the ScrollControlHandledMouseMove event.
Declaration
protected virtual void OnScrollControlHandledMouseMove(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e | A System.Windows.Forms.MouseEventArgs that contains the event data. |
OnScrollControlHandledMouseUp(MouseEventArgs)
Raises the ScrollControlHandledMouseUp event.
Declaration
protected virtual void OnScrollControlHandledMouseUp(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e | A System.Windows.Forms.MouseEventArgs that contains the event data. |
OnScrollControlMouseDown(CancelMouseEventArgs)
Raises the ScrollControlMouseDown event.
Declaration
protected virtual void OnScrollControlMouseDown(CancelMouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
CancelMouseEventArgs | e | A CancelMouseEventArgs that contains the event data. |
OnScrollControlMouseMove(CancelMouseEventArgs)
Raises the ScrollControlMouseMove event.
Declaration
protected virtual void OnScrollControlMouseMove(CancelMouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
CancelMouseEventArgs | e | A CancelMouseEventArgs that contains the event data. |
OnScrollControlMouseUp(CancelMouseEventArgs)
Raises the ScrollControlMouseUp event.
Declaration
protected virtual void OnScrollControlMouseUp(CancelMouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
CancelMouseEventArgs | e | A CancelMouseEventArgs that contains the event data. |
OnScrollTipFeedback(ScrollTipFeedbackEventArgs)
Raises the ScrollTip event.
Declaration
protected virtual void OnScrollTipFeedback(ScrollTipFeedbackEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
ScrollTipFeedbackEventArgs | e | A ScrollTipFeedbackEventArgs that contains the event data. |
OnSetCursor(ref Message)
Declaration
protected virtual void OnSetCursor(ref Message m)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Message | m |
OnShowContextMenu(ShowContextMenuEventArgs)
Declaration
protected virtual void OnShowContextMenu(ShowContextMenuEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
ShowContextMenuEventArgs | e |
Remarks
Raises the ShowContextMenu event when the user right-clicks inside the control.
You can cancel showing a content menu when you assign True to System.ComponentModel.CancelEventArgs.Cancel.
OnSizeChanged(EventArgs)
Declaration
protected override void OnSizeChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnSplitterPaneClosed(EventArgs)
Raises the SplitterPaneClosed event.
Declaration
protected virtual void OnSplitterPaneClosed(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An System.EventArgs that contains the event data. |
OnSplitterPaneClosing(EventArgs)
Raises the SplitterPaneClosing event.
Declaration
protected virtual void OnSplitterPaneClosing(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An System.EventArgs that contains the event data. |
OnStartAutoScrolling(StartAutoScrollingEventArgs)
Raises the StartAutoScrolling event.
Declaration
protected virtual void OnStartAutoScrolling(StartAutoScrollingEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
StartAutoScrollingEventArgs | e | A StartAutoScrollingEventArgs that contains the event data. |
OnThemeNameChanged(String)
Helps to set the scrollbars based on visual style.
Declaration
public override void OnThemeNameChanged(string themeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | themeName |
Overrides
OnTouchPan(Point, Boolean)
Adjust the HScrollBar and VScrollBar values based on current touch position
Declaration
protected virtual bool OnTouchPan(Point currentTouchPoint, bool isSwipeScroll)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | currentTouchPoint | Current touch position |
System.Boolean | isSwipeScroll | Used to decide the doing swipe operation or pan operation |
Returns
Type |
---|
System.Boolean |
OnTouchPanBegin(Point)
Initially save the current scrollbar values when begin the panning operation
Declaration
protected virtual bool OnTouchPanBegin(Point touchBeginPoint)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | touchBeginPoint | Touch begin position |
Returns
Type | Description |
---|---|
System.Boolean | return true |
OnTouchPanEnd(Point)
After panning operation completes save the current scroll bar values
Declaration
protected virtual bool OnTouchPanEnd(Point touchEndPoint)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | touchEndPoint | touch end position |
Returns
Type | Description |
---|---|
System.Boolean | return true |
OnUpdatingChanged(EventArgs)
Raises the UpdatingChanged event.
Declaration
protected virtual void OnUpdatingChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | A System.EventArgs that contains the event data. |
Remarks
The event handler for this event can check Updating to determine if BeginUpdate() or EndUpdate() was called.
OnValidated(EventArgs)
Declaration
protected override void OnValidated(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnValidating(CancelEventArgs)
Declaration
protected override void OnValidating(CancelEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.ComponentModel.CancelEventArgs | e |
OnValidatingLostFocus()
This method is called if the control's OnControlLostFocus() notification occurs while handling a System.Windows.Forms.Control.Validating event. This typically occurs if a message box is displayed from a System.Windows.Forms.Control.Validating event handler.
Declaration
protected virtual void OnValidatingLostFocus()
OnVerticalScroll(ScrollEventArgs)
Raises the VerticalScroll event.
Declaration
protected virtual void OnVerticalScroll(ScrollEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.ScrollEventArgs | e | A System.Windows.Forms.ScrollEventArgs that contains the event data. |
OnVisibleChanged(EventArgs)
Declaration
protected override void OnVisibleChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnVScroll(Object, ScrollEventArgs)
Listens for the vertical scrollbar's scroll event.
Declaration
protected virtual void OnVScroll(object sender, ScrollEventArgs se)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | A System.Object that contains data about the control. |
System.Windows.Forms.ScrollEventArgs | se | A System.Windows.Forms.ScrollEventArgs that contains the event data. |
OnVScrollBarValueChanged(Object, EventArgs)
Handles the ValueChanged of the vertical scrollbar.
Declaration
protected virtual void OnVScrollBarValueChanged(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The source of the event. |
System.EventArgs | e | An System.EventArgs that contains the event data. |
OnWindowScrolled(ScrollWindowEventArgs)
Raises the WindowScrolled event.
Declaration
protected virtual void OnWindowScrolled(ScrollWindowEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
ScrollWindowEventArgs | e | A ScrollWindowEventArgs that contains the event data. |
OnWindowScrolling(ScrollWindowEventArgs)
Raises the WindowScrolling event.
Declaration
protected virtual void OnWindowScrolling(ScrollWindowEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
ScrollWindowEventArgs | e | A ScrollWindowEventArgs that contains the event data. |
ProcessMouseWheel(MouseEventArgs)
Delegates the MouseWheelEvent from a child control.
Declaration
public void ProcessMouseWheel(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e | A MouseEventArgs that holds event data. |
Remarks
public class GridTextBox: RichTextBox
{
private GridTextBoxCell parent;
protected override void OnMouseWheel(MouseEventArgs e)
{
parent.Grid.ProcessMouseWheel(e);
}
}
QueryFocusInside()
Indicates whether this control contains focus. Override this method if you want to show drop-down windows and indicate the control has not lost focus when the drop-down is shown.
Declaration
public virtual bool QueryFocusInside()
Returns
Type | Description |
---|---|
System.Boolean | True if the control or any child control has focus; false otherwise. |
ResetInsideScrollMargins()
Resets the InsideScrollMargins property to its default value.
Declaration
public void ResetInsideScrollMargins()
ResetMouseController()
Raises a CancelMode for the active mouse controller for this control.
Declaration
public void ResetMouseController()
Remarks
MouseControllerDispatcher holds a collection of mouse controllers.
ResetMouseWheelScrollLines()
Resets the
Declaration
public void ResetMouseWheelScrollLines()
ScrollWindow(Int32, Int32, Rectangle, Rectangle, Boolean)
Scrolls the contents of the control similar to the ScrollWindow Windows API.
Declaration
public virtual Rectangle ScrollWindow(int xAmount, int yAmount, Rectangle rect, Rectangle clipRect, bool allowUpdate)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | xAmount | |
System.Int32 | yAmount | |
System.Drawing.Rectangle | rect | |
System.Drawing.Rectangle | clipRect | |
System.Boolean | allowUpdate |
Returns
Type |
---|
System.Drawing.Rectangle |
Remarks
The method will raise a WindowScrolling event before the contents are scrolled and a WindowScrolled event after the contents have been scrolled.
If DisableScrollWindow is True, any calls to the ScrollWindow method will simply invalidate the affect region. The rendering origin will still be recorded correctly and WindowScrolling and WindowScrolled events will be raised.
If DisableScrollWindow is False, ScrollWindow will scroll the contents of the control.
ShouldPrepareUpdate()
Call this method to check if you should do any update calculations for the view in your control and to notify scroll control that the control's content needs to be updated.
Declaration
public bool ShouldPrepareUpdate()
Returns
Type | Description |
---|---|
System.Boolean | True if you should invalidate areas that need to be redrawn; False if a complete Refresh for the control is pending and therefore invalidating the view is not necessary. |
ShouldPrepareUpdate(Boolean)
Call this method to check if you should do any update calculations for the view in your control and to notify scroll control that the control's content needs to be updated.
Declaration
public bool ShouldPrepareUpdate(bool markPaintPending)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | markPaintPending | If markPaintPending is True, ScrollControl will assume the control needs to be repainted in a subsequent EndUpdate call. |
Returns
Type | Description |
---|---|
System.Boolean | True if you should Invalidate regions to be repainted in your control. It will return False if a complete Refresh of the control is pending and you don't need to invalidate individual regions of your control. |
ShouldSerializeMouseWheelScrollLines()
Indicates whether serialize MouseWheelScrollLines property value or not.
Declaration
public bool ShouldSerializeMouseWheelScrollLines()
Returns
Type |
---|
System.Boolean |
StartAutoScrollTimer(ScrollBarWrapper, ScrollEventType)
Starts the AutoScroll timer.
Declaration
protected void StartAutoScrollTimer(ScrollBarWrapper scrollBar, ScrollEventType saType)
Parameters
Type | Name | Description |
---|---|---|
ScrollBarWrapper | scrollBar | The scrollbar to be automatically scrolled. |
System.Windows.Forms.ScrollEventType | saType | The event to be sent to this scrollbar. |
StartAutoScrollTimer(Message)
Starts the AutoScroll timer.
Declaration
protected void StartAutoScrollTimer(Message m)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Message | m | The message to be sent to the current control. |
StartAutoScrollTimer(Message, Int32)
Starts the AutoScroll timer.
Declaration
protected void StartAutoScrollTimer(Message m, int interval)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Message | m | The message to be sent to the current control. |
System.Int32 | interval | The initial interval for sending messages. |
UpdateNc()
Invalidate and wait till area update on Non Client area.
Declaration
protected virtual void UpdateNc()
UpdateScrollBars()
Updates scrollbars to reflect recent changes in scroll position, minimum and maximum scroll position values.
Declaration
public virtual void UpdateScrollBars()
UpdateScrollTips(ScrollEventArgs)
Declaration
protected virtual void UpdateScrollTips(ScrollEventArgs se)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.ScrollEventArgs | se |
UpdateStyles()
Forces the assigned styles to be reapplied to the control.
Declaration
public void UpdateStyles()
WndProc(ref Message)
Declaration
protected override void WndProc(ref Message msg)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Message | msg |
Events
AccelerateScrollingChanged
Occurs when the AccelerateScrolling property has been changed.
Declaration
public event EventHandler AccelerateScrollingChanged
Event Type
Type |
---|
System.EventHandler |
AutoScrollingChanged
Occurs when the AutoScrolling property is changed.
Declaration
public event EventHandler AutoScrollingChanged
Event Type
Type |
---|
System.EventHandler |
Remarks
If you want to prevent autoscrolling, you should handle this event and reset the AutoScrolling property to ScrollBars.None.
CancelMode
Occurs when the window receives a WM_CANCELMODE message.
Declaration
public event EventHandler CancelMode
Event Type
Type |
---|
System.EventHandler |
Remarks
WM_CANCELMODE is sent to cancel certain modes, such as mouse capture. For example, the system sends this message to the active window when a dialog box or message box is displayed. Certain functions also send this message explicitly to the specified window regardless of whether it is the active window. For example, the EnableWindow function sends this message when disabling the specified window.
Deactivated
Occurs when both OnControlLostFocus() and OnLeave(EventArgs) occur.
Declaration
public event EventHandler Deactivated
Event Type
Type |
---|
System.EventHandler |
FillSplitterPaneChanged
Occurs when the FillSplitterPane value has changed.
Declaration
public event EventHandler FillSplitterPaneChanged
Event Type
Type |
---|
System.EventHandler |
HorizontalScroll
Occurs when horizontal scrollbar is moved.
Declaration
public event ScrollEventHandler HorizontalScroll
Event Type
Type |
---|
System.Windows.Forms.ScrollEventHandler |
IntelliMouseDragScrolling
Occurs when the user presses the mouse wheel and drags the mouse.
Declaration
public event IntelliMouseDragScrollEventHandler IntelliMouseDragScrolling
Event Type
Type |
---|
IntelliMouseDragScrollEventHandler |
Remarks
Set Scrolled of IntelliMouseDragScrollEventArgs to True if you provide customized scrolling in your event handler.
MouseWheelZoom
Occurs when the user holds the Control Key and rolls the mouse wheel.
Declaration
public event MouseWheelZoomEventHandler MouseWheelZoom
Event Type
Type |
---|
MouseWheelZoomEventHandler |
Office2007ScrollBarsChanged
Occurs when the Office2007ScrollBars property has changed.
Declaration
public event EventHandler Office2007ScrollBarsChanged
Event Type
Type |
---|
System.EventHandler |
Office2007ScrollBarsColorSchemeChanged
Occurs when the Office2007ScrollBarsColorScheme property has changed.
Declaration
public event EventHandler Office2007ScrollBarsColorSchemeChanged
Event Type
Type |
---|
System.EventHandler |
Office2010ScrollBarsColorSchemeChanged
Occurs when the Office2010ScrollBarsColorScheme property has changed.
Declaration
public event EventHandler Office2010ScrollBarsColorSchemeChanged
Event Type
Type |
---|
System.EventHandler |
Office2016ScrollBarsColorSchemeChanged
Occurs when the Office2016ScrollBarsColorScheme property has changed.
Declaration
public event EventHandler Office2016ScrollBarsColorSchemeChanged
Event Type
Type |
---|
System.EventHandler |
OfficeScrollBarsChanged
Occurs when the OfficeScrollBarsChanged property has changed.
Declaration
public event ScrollControl.OfficeScrollBarsEventHandler OfficeScrollBarsChanged
Event Type
Type |
---|
ScrollControl.OfficeScrollBarsEventHandler |
ScrollbarsVisibleChanged
Occurs when scrollbars are hidden or shown.
Declaration
public event EventHandler ScrollbarsVisibleChanged
Event Type
Type |
---|
System.EventHandler |
ScrollControlHandledMouseDown
Occurs after a System.Windows.Forms.Control.MouseDown is raised.
Declaration
public event MouseEventHandler ScrollControlHandledMouseDown
Event Type
Type |
---|
System.Windows.Forms.MouseEventHandler |
ScrollControlHandledMouseMove
Occurs after a System.Windows.Forms.Control.MouseMove event is raised and after auto-scrolling.
Declaration
public event MouseEventHandler ScrollControlHandledMouseMove
Event Type
Type |
---|
System.Windows.Forms.MouseEventHandler |
ScrollControlHandledMouseUp
Occurs after a System.Windows.Forms.Control.MouseUp event is raised.
Declaration
public event MouseEventHandler ScrollControlHandledMouseUp
Event Type
Type |
---|
System.Windows.Forms.MouseEventHandler |
ScrollControlMouseDown
Occurs before a System.Windows.Forms.Control.MouseDown is raised and allows you to cancel the mouse event.
Declaration
public event CancelMouseEventHandler ScrollControlMouseDown
Event Type
Type |
---|
CancelMouseEventHandler |
ScrollControlMouseMove
Occurs before a System.Windows.Forms.Control.MouseMove is raised and allows you to cancel the mouse event.
Declaration
public event CancelMouseEventHandler ScrollControlMouseMove
Event Type
Type |
---|
CancelMouseEventHandler |
ScrollControlMouseUp
Occurs before a System.Windows.Forms.Control.MouseUp is raised and allows you to cancel the mouse event.
Declaration
public event CancelMouseEventHandler ScrollControlMouseUp
Event Type
Type |
---|
CancelMouseEventHandler |
ScrollTipFeedback
Occurs when the user is dragging the scrollbar thumb.
Declaration
public event ScrollTipFeedbackEventHandler ScrollTipFeedback
Event Type
Type |
---|
ScrollTipFeedbackEventHandler |
ShowContextMenu
The ShowContextMenu event occurs when the user right-clicks inside the control.
Declaration
public event ShowContextMenuEventHandler ShowContextMenu
Event Type
Type |
---|
ShowContextMenuEventHandler |
Remarks
You can cancel showing a content menu when you assign True to System.ComponentModel.CancelEventArgs.Cancel.
SplitterPaneClosed
Occurs when the splitter control has closed the pane with this control.
Declaration
public event EventHandler SplitterPaneClosed
Event Type
Type |
---|
System.EventHandler |
SplitterPaneClosing
Occurs when the splitter control is closing the pane with this control.
Declaration
public event EventHandler SplitterPaneClosing
Event Type
Type |
---|
System.EventHandler |
StartAutoScrolling
Occurs when accelerated scrollbar scrolling or mouse drag-scrolling starts.
Declaration
public event StartAutoScrollingEventHandler StartAutoScrolling
Event Type
Type |
---|
StartAutoScrollingEventHandler |
UpdatingChanged
Occurs when BeginUpdate(BeginUpdateOptions) has been called the first time or EndUpdate(Boolean) has been called the last time.
Declaration
public event EventHandler UpdatingChanged
Event Type
Type |
---|
System.EventHandler |
VerticalScroll
Occurs when vertical scrollbar is moved.
Declaration
public event ScrollEventHandler VerticalScroll
Event Type
Type |
---|
System.Windows.Forms.ScrollEventHandler |
WindowScrolled
Occurs after the window has been scrolled.
Declaration
public event ScrollWindowEventHandler WindowScrolled
Event Type
Type |
---|
ScrollWindowEventHandler |
WindowScrolling
Occurs while the window is being scrolled.
Declaration
public event ScrollWindowEventHandler WindowScrolling
Event Type
Type |
---|
ScrollWindowEventHandler |
Explicit Interface Implementations
INonClientPaintingSupport.NonClientPaint(PaintEventArgs, Rectangle, Rectangle)
Declaration
IntPtr INonClientPaintingSupport.NonClientPaint(PaintEventArgs e, Rectangle displayRect, Rectangle windowRectInScreen)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e | |
System.Drawing.Rectangle | displayRect | |
System.Drawing.Rectangle | windowRectInScreen |
Returns
Type |
---|
System.IntPtr |
ISplitterPaneSupport.FillSplitterPane
Declaration
bool ISplitterPaneSupport.FillSplitterPane { get; }
Returns
Type |
---|
System.Boolean |
ISplitterPaneSupport.PaneClosed()
Declaration
void ISplitterPaneSupport.PaneClosed()
ISplitterPaneSupport.PaneClosing()
Declaration
void ISplitterPaneSupport.PaneClosing()
ISupportUpdating.Updating
Declaration
bool ISupportUpdating.Updating { get; }
Returns
Type |
---|
System.Boolean |
IVisualStyle.VisualTheme
Declaration
string IVisualStyle.VisualTheme { get; set; }
Returns
Type |
---|
System.String |