Desktop Functions: Smart Device Functions:
|
Search Results for "scrollbar" in [All]user32
static extern bool EnableScrollBar(IntPtr hWnd, uint wSBflags, uint wArrows);
Private Shared Function EnableScrollBar(ByVal hWnd As IntPtr, <MarshalAs(UnmanagedType.U4)>wSBflags As SBFlags, <MarshalAs(UnmanagedType.U4)>wArrows As SBArrows) As <MarshalAs(UnmanagedType.Bool)>Boolean
Public Declare Function EnableScrollBar Lib "user32" _
static extern bool EnableScrollBar(IntPtr hWnd, uint wSBflags, uint wArrows);
private void DisableHScrollBar(Control control)
EnableScrollBar(control.Handle, (uint)SBTYPES.SB_HORZ, (uint)SBArrows.ESB_DISABLE_BOTH); 2: FindWindow
/// <param name="parentControl">The parent window of the scrollbar.</param>
/// <returns>Handle to the scrollbar window.</returns>
private IntPtr GetHandleToHorizontalScrollBar(Control parent)
"WindowsForms10.SCROLLBAR.app.0." + appDomainHexedHash, // Class name to seek (viewable in the Spy++ tool) 3: FindWindowEx
/// <param name="parentControl">The parent window of the scrollbar.</param>
/// <returns>Handle to the scrollbar window.</returns>
private IntPtr GetHandleToHorizontalScrollBar(Control parent)
"WindowsForms10.SCROLLBAR.app.0." + appDomainHexedHash, // Class name to seek (viewable in the Spy++ tool)
[DllImport( "user32.dll", SetLastError=true, EntryPoint="GetScrollBarInfo")]
private static extern int GetScrollBarInfo(IntPtr hWnd, uint idObject, ref SCROLLBARINFO psbi);
public struct SCROLLBARINFO
public Rectangle rcScrollBar; This didn't work for me with the Rectangle type for SCROLLBARINFO.rcScrollBar. To rectify this I altered this declaration to type RECT using the following standard definition.
SCROLLBARINFO psbi = new SCROLLBARINFO();
int nResult = GetScrollBarInfo(this.Handle, OBJID_CLIENT, ref psbi); // "this" is a scrollbar if you have a reference to a System.Windows.Forms.ScrollBar, use it's properties. otherwise,
SystemInformation.HorizontalScrollbar*
SystemInformation.VerticalScrollbar*
Declare Function GetScrollInfo Lib "user32" (ByVal hWnd As IntPtr, ByVal fnBar As ScrollBarDirection, ByRef lpsi As SCROLLINFO) As Integer
// such that no horizontal scrollbar will be needed
int SCROLLBARWIDTH = SystemInformation.VerticalScrollBarWidth;
GetScrollInfo( RichTextBox1.Handle, (int) ScrollBarDirection.SB_HORZ, ref si );
int iWidth = si.nMax - si.nMin + 2 * BORDERWIDTH + SCROLLBARWIDTH + 2;
Private Function GetScrollBarPageSize(ByVal hWnd As IntPtr, ByVal fnBar As Integer) As Integer 6: GetScrollPos
7: GetSysColor
8: mouse_event This allows you to smoothly increment the scrollbar, instead of relying on the inconsistent wheel delta, unsafe private void hScrollBar1_Scroll( object sender, ScrollEventArgs e )
ScrollDelta = FPosition - e.NewValue; // FPosition is the previous scrollbar position
ScrollRect.Right = this.Width - SystemInformation.VerticalScrollBarWidth; 10: ShowScrollBar
public static extern bool ShowScrollBar(IntPtr hWnd, int wBar, [MarshalAs(UnmanagedType.Bool)] bool bShow); Private Declare Function ShowScrollBar Lib "user32" (ByVal hwnd As Long, ByVal wBar As Long, ByVal bShow As Long) As Long http://www.vb-helper.com/howto_show_hide_text_scrollbar.html http://www.vb-helper.com/howto_show_hide_both_scrollbars.html In the TextBox's Change event handler, use the PictureBox's TextHeight function to see how tall the text is. If the text is too big to fit in the TextBox, we need to display the scrollbar. If the need for the scrollbar has changed, use the ShowScrollBar API function to show or hide it. Private m_ScrollBarVisible As Boolean Private Declare Function ShowScrollBar Lib "user32" (ByVal _ Dim needs_scrollbar As Boolean
' See if we need the scrollbar.
needs_scrollbar = _
If needs_scrollbar <> m_ScrollBarVisible Then
' Show or hide the scrollbar.
m_ScrollBarVisible = needs_scrollbar
ShowScrollBar txtValue.hwnd, SB_VERT, _
m_ScrollBarVisible Public Shared Function ShowScrollBar(ByVal hWnd As System.IntPtr, ByVal wBar As Integer, ByVal bShow As Boolean) As Boolean Call ShowScrollBar(hWnd1, SB_VERT, mytrue) uxtheme11: GetThemePartSize
// Horizontal Scrollbar States
// Vertical Scrollbar States Constants12: COLOR_
COLOR_SCROLLBAR = 0,
SCROLLBAR = 0,
COLOR_SCROLLBAR = 0 13: EM_
SHOWSCROLLBAR = WM.USER + 96, 14: Window styles
public const uint WS_EX_LEFTSCROLLBAR = 0x00004000;
public const uint WS_EX_RIGHTSCROLLBAR = 0x00000000;
WS_EX_LEFTSCROLLBAR = 0x00004000,
WS_EX_RIGHTSCROLLBAR = 0x00000000,
WS_EX_LEFTSCROLLBAR = 16384
WS_EX_RIGHTSCROLLBAR = 0 15: WINERROR
public const int ERROR_NO_SCROLLBARS = 1447;
public const int ERROR_INVALID_SCROLLBAR_RANGE = 1448; 16: WM
private const UInt32 WM_CTLCOLORSCROLLBAR = 0x0137;
WM_CTLCOLORSCROLLBAR = &H137
WM_CTLCOLORSCROLLBAR equ 137h coredll17: SetScrollPos Thanks to: http://www.codeproject.com/Articles/10839/How-to-change-scrollbars-position-in-a-multiline-t
public static void set_scrollbar(IntPtr Handle, int Row) 18: SetSysColors
/// 0 COLOR_SCROLLBAR Color of the gray area of a scroll bar.
public const int COLOR_SCROLLBAR = (0 | SYS_COLOR_INDEX_FLAG);
COLOR_SCROLLBAR,
Color.Transparent.ToArgb() & 0x00ffffff, //COLOR_SCROLLBAR Structures19: SCROLLINFO
20: WNDCLASS
21: WNDCLASSEX
Enums22: SBArrows
23: SBFlags
26: WindowsMessages
/// The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll bar control when the control is about to be drawn. By responding to this message, the parent window can use the display context handle to set the background color of the scroll bar control.
CTLCOLORSCROLLBAR = 0x0137,
'''The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll bar control when the control is about to be drawn. By responding to this message the parent window can use the display context handle to set the background color of the scroll bar control.
WM_CTLCOLORSCROLLBAR = &H137 27: WindowStyles
WS_EX_LEFTSCROLLBAR = 0x00004000,
WS_EX_RIGHTSCROLLBAR = 0x00000000,
WS_EX_LEFTSCROLLBAR = 0x00004000,
WS_EX_RIGHTSCROLLBAR = 0x00000000,
WS_EX_LEFTSCROLLBAR = &H4000
WS_EX_RIGHTSCROLLBAR = &H0
WS_EX_LEFTSCROLLBAR As Long = &H4000
WS_EX_RIGHTSCROLLBAR As Long = &H0 28: WindowStylesEx
WS_EX_LEFTSCROLLBAR = 0x00004000,
WS_EX_RIGHTSCROLLBAR = 0x00000000,
WS_EX_LEFTSCROLLBAR = &H4000
WS_EX_RIGHTSCROLLBAR = &H0
WS_EX_LEFTSCROLLBAR As Long = &H4000
WS_EX_RIGHTSCROLLBAR As Long = &H0 |