Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

SetScrollInfo (user32)
 
.
Summary

C# Signature:

[DllImport("user32.dll")]
static extern int SetScrollInfo(IntPtr hwnd, int fnBar, [In] ref SCROLLINFO
   lpsi, bool fRedraw);

VB.Net Signature:

  <DllImport("user32.dll")> _
  Public Function SetScrollInfo(ByVal hWnd As IntPtr, ByVal fnBar As ScrollBarDirection, _
    ByRef lpsi As SCROLLINFO, ByVal bRepaint As Boolean) As Integer
  End Function

User-Defined Types:

    //fnBar values
    enum SBTYPES
    {
        SB_HORZ = 0,
        SB_VERT = 1,
        SB_CTL = 2,
        SB_BOTH = 3
    }
    //lpsi values
    enum LPCSCROLLINFO
    {
       SIF_RANGE = 0x0001,
       SIF_PAGE = 0x0002,
       SIF_POS = 0x0004,
       SIF_DISABLENOSCROLL = 0x0008,
       SIF_TRACKPOS = 0x0010,
       SIF_ALL = (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS)
    }

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

SCROLLINFO scrollinfo = new SCROLLINFO();

scrollinfo.cbSize = Marshal.SizeOf( typeof(SCROLLINFO) );

scrollinfo.fMask = Convert.ToInt32(LPCSCROLLINFO.SIF_RANGE);

scrollinfo.nMin = 0;

scrollinfo.nMax = 4;

SetScrollInfo( MyControl.Handle, (int) SBTYPES.SB_VERT, ref scrollinfo, true );

Alternative Managed API:

Do you know one? Please contribute it!

Documentation
SeeAlso

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Find References
Show Printable Version
Revisions