Windows forms scrollablecontrol


















Thank you. Microsoft makes no warranties, express or implied, with respect to the information provided here. The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the Scroll event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing MessageBox. Show with Console. WriteLine or appending the message to a multiline TextBox.

To run the example code, paste it into a project that contains an instance of a type that inherits from ScrollableControl , such as a Panel or ContainerControl.

GetChildAtPoint Point. Retrieves the child control that is located at the specified coordinates. Serves as the default hash function. GetNextControl Control, Boolean. Retrieves the next control forward or back in the tab order of child controls. GetPreferredSize Size. Retrieves the size of a rectangular area into which a control can be fitted.

Retrieves the bounds within which the control is scaled. GetScrollState Int GetService Type. GetStyle ControlStyles. Retrieves the value of the specified control style bit for the control.

Determines if the control is a top-level control. Conceals the control from the user. Obtains a lifetime service object to control the lifetime policy for this instance. Called after the control has been added to another container. Invalidates the entire surface of the control and causes the control to be redrawn. Invalidate Boolean. Invalidate Rectangle. Invalidate Rectangle, Boolean. Invalidate Region.

Invalidate Region, Boolean. Invoke Action. Executes the specified delegate on the thread that owns the control's underlying window handle.

Invoke Delegate. Invoke Delegate, Object[]. IsInputChar Char. Determines if a character is an input character that the control recognizes. IsInputKey Keys. LogicalToDeviceUnits Int LogicalToDeviceUnits Size. MemberwiseClone Boolean. NotifyInvalidate Rectangle. OnClick EventArgs. OnCursorChanged EventArgs. OnDockChanged EventArgs. OnDoubleClick EventArgs. OnDragLeave EventArgs. OnEnabledChanged EventArgs. OnEnter EventArgs. OnFontChanged EventArgs. OnGotFocus EventArgs.

OnHandleCreated EventArgs. OnHandleDestroyed EventArgs. OnInvalidated InvalidateEventArgs. OnLayout LayoutEventArgs. OnLeave EventArgs. OnLocationChanged EventArgs.

OnLostFocus EventArgs. OnMarginChanged EventArgs. OnMouseEnter EventArgs. OnMouseHover EventArgs. OnMouseLeave EventArgs. OnMove EventArgs. OnNotifyMessage Message. Notifies the control of Windows messages.

OnPaddingChanged EventArgs. OnPaint PaintEventArgs. Paints the background of the control. OnParentChanged EventArgs. OnPrint PaintEventArgs. OnRegionChanged EventArgs.

OnResize EventArgs. OnScroll ScrollEventArgs. OnSizeChanged EventArgs. OnStyleChanged EventArgs. OnTextChanged EventArgs. OnValidated EventArgs. OnValidating CancelEventArgs. OnVisibleChanged EventArgs. Forces the control to apply layout logic to all its child controls. PerformLayout Control, String.

PointToClient Point. Computes the location of the specified screen point into client coordinates. PointToScreen Point. Computes the location of the specified client point into screen coordinates. PreProcessControlMessage Message. Preprocesses keyboard or input messages within the message loop before they are dispatched. PreProcessMessage Message. ProcessCmdKey Message, Keys. Processes a command key. ProcessDialogChar Char.

Processes a dialog character. ProcessDialogKey Keys. Processes a dialog key. ProcessKeyEventArgs Message. Processes a key message and generates the appropriate control events. ProcessKeyMessage Message.

Processes a keyboard message. ProcessKeyPreview Message. Previews a keyboard message. ProcessMnemonic Char. Processes a mnemonic character. Raises the appropriate drag event. Raises the appropriate key event. Raises the appropriate mouse event. Raises the appropriate paint event. Forces the re-creation of the handle for the control. RectangleToClient Rectangle. Computes the size and location of the specified screen rectangle in client coordinates.

RectangleToScreen Rectangle. Computes the size and location of the specified client rectangle in screen coordinates. Provides constants for rescaling the control when a DPI change occurs. Resumes usual layout logic. ResumeLayout Boolean. Resumes usual layout logic, optionally forcing an immediate layout of pending layout requests. RtlTranslateAlignment ContentAlignment. RtlTranslateAlignment HorizontalAlignment.

RtlTranslateContent ContentAlignment. RtlTranslateHorizontal HorizontalAlignment. Scale Single. Scales the control and any child controls. Scale Single, Single. Scales the entire control and any child controls. Scale SizeF. Scales the control and all child controls by the specified scaling factor.

Scales a logical bitmap value to it's equivalent device unit value when a DPI change occurs. Scales a control's location, size, padding and margin. ScaleCore Single, Single. ScrollControlIntoView Control. Scrolls the specified child control into view on an auto-scroll enabled control. ScrollToControl Control. Activates the control. Select Boolean, Boolean. Activates the next control.

Sends the control to the back of the z-order. Sets the bounds of the control to the specified location and size. Sets the specified bounds of the control to the specified location and size. Performs the work of setting the specified bounds of this control. Sets the size of the client area of the control. SetScrollState Int32, Boolean. SetStyle ControlStyles, Boolean. SetTopLevel Boolean. Sets the control as the top-level control. SetVisibleCore Boolean.

Sets the control to the specified visible state. Displays the control to the user. SizeFromClientSize Size. Determines the size of the entire control from the height and width of its client area.

Temporarily suspends the layout logic for the control. Causes the control to redraw the invalidated regions within its client area. Updates the bounds of the control with the current size and location. Updates the bounds of the control with the specified size and location. Updates the bounds of the control with the specified size, location, and client size.

Forces the assigned styles to be reapplied to the control. Updates the control in its parent's z-order. WndProc Message. This event is not relevant for this class. Occurs when the focus or keyboard user interface UI cues change. Occurs when the control is clicked.

Occurs when the control is double-clicked. Occurs when a drag-and-drop operation is completed. Occurs when an object is dragged into the control's bounds. Occurs when an object is dragged out of the control's bounds.

Occurs when an object is dragged over the control's bounds. Occurs when the control is entered. Occurs during a drag operation. Occurs when the control receives focus. Occurs when a handle is created for the control. Occurs when the control's handle is in the process of being destroyed. Occurs when the user requests help for a control. Occurs when a control's display requires redrawing.

Occurs when a key is pressed while the control has focus. Occurs when a character. Occurs when a key is released while the control has focus. Occurs when a control should reposition its child controls. The example was written under the assumption that you have a Form that contains a Panel with a Button on it. To enable auto-scrolling, place the button outside of the client area of the Panel. The AutoScrollPosition property represents the location of the visible portion of a scrollable control.

Use this property to change the portion of the control that is displayed. When adding controls programmatically to a form, use the AutoScrollPosition property to position the control either inside or outside of the current viewable scroll area.

The X and Y coordinate values retrieved are negative if the control has scrolled away from its starting position 0,0. When you set this property, you must always assign positive X and Y values to set the scroll position relative to the starting position. For example, if you have a horizontal scroll bar and you set x and y to , you move the scroll pixels to the right; if you then set x and y to , the scroll appears to jump the left by pixels, because you are setting it pixels away from the starting position.

To detect when AutoScrollPosition changes, create an event handler for the Paint event, save the old position value in a private variable, and compare the new value to the old value on subsequent Paint events.



0コメント

  • 1000 / 1000