VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Creates a flat scrollbar onto an object or form.

by Les Blancs (1 Submission)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 14th June 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Creates a flat scrollbar onto an object or form.

API Declarations


Private Declare Function FlatSB_SetScrollRange Lib "comctl32" (ByVal hWnd As Long, ByVal code As Long, ByVal nMinPos As Long, ByVal nMaxPos As Long, ByVal fRedraw As Boolean) As Long
Private Declare Function FlatSB_ShowScrollBar Lib "comctl32" (ByVal hWnd As Long, ByVal code As Long, ByVal fShow As Boolean) As Boolean
Private Declare Function FlatSB_GetScrollPos Lib "comctl32" (ByVal hWnd As Long, ByVal code As Long) As Long

Rate Creates a flat scrollbar onto an object or form.



    Dim SI As SCROLLINFO
    InitializeFlatSB uObject.hWnd
    FlatSB_SetScrollProp uObject.hWnd, WSB_PROP_VSTYLE, FSB_ENCARTA_MODE, False
    FlatSB_EnableScrollBar uObject.hWnd, SB_VERT, ESB_DISABLE_UP
    FlatSB_SetScrollRange uObject.hWnd, SB_VERT, 20, 80, False
    FlatSB_SetScrollPos uObject.hWnd, SB_VERT, 60, False
    FlatSB_ShowScrollBar uObject.hWnd, SB_HORZ, False
    SI.cbSize = Len(SI)
    SI.fMask = SIF_ALL
    FlatSB_GetScrollInfo uObject.hWnd, SB_VERT, SI
    SI.nPos = SI.nPos - 10
    FlatSB_SetScrollInfo uObject.hWnd, SB_VERT, SI, True
    Dim RetMin As Long, RetMax As Long
    FlatSB_GetScrollRange uObject.hWnd, SB_VERT, RetMin, RetMax
    Me.AutoRedraw = True
End Sub
Private Sub RemoveScrollB(ByVal u As Object)
    UninitializeFlatSB u.hWnd
End Sub
Private Sub Form_Load()
FlatScroll Me
End Sub


Download this snippet    Add to My Saved Code

Creates a flat scrollbar onto an object or form. Comments

No comments have been posted about Creates a flat scrollbar onto an object or form.. Why not be the first to post a comment about Creates a flat scrollbar onto an object or form..

Post your comment

Subject:
Message:
0/1000 characters