偶的使d办的,only one可以mail吗?[email protected]我得目的使:上述三个控件能构在 不添加别的控件的基础上原有的滚动条变成平面不知道sendmessage可以实现吗?或者用vb自己的只有控件???

解决方案 »

  1.   

    在运行中ListView.FlatScrollBar = True可以实现效果,但是,用report显示数据的时候,会出现拖动的时候在最左边和最下面出现添加记录的时候没有的空白数据空格如何避免???或者…………请大家帮忙!!!
      

  2.   

    Const WS_VSCROLL = &H200000
    Const WS_HSCROLL = &H100000
    Const GWL_STYLE = (-16)Const WSB_PROP_CYVSCROLL = &H1
    Const WSB_PROP_CXHSCROLL = &H2
    Const WSB_PROP_CYHSCROLL = &H4
    Const WSB_PROP_CXVSCROLL = &H8
    Const WSB_PROP_CXHTHUMB = &H10
    Const WSB_PROP_CYVTHUMB = &H20
    Const WSB_PROP_VBKGCOLOR = &H40
    Const WSB_PROP_HBKGCOLOR = &H80
    Const WSB_PROP_VSTYLE = &H100
    Const WSB_PROP_HSTYLE = &H200
    Const WSB_PROP_WINSTYLE = &H400
    Const WSB_PROP_PALETTE = &H800
    Const WSB_PROP_MASK = &HFFF
    Const FSB_FLAT_MODE = 2
    Const FSB_ENCARTA_MODE = 1
    Const FSB_REGULAR_MODE = 0Const SB_HORZ = 0
    Const SB_VERT = 1
    Const SB_BOTH = 3Const ESB_ENABLE_BOTH = &H0
    Const ESB_DISABLE_BOTH = &H3
    Const ESB_DISABLE_LEFT = &H1
    Const ESB_DISABLE_RIGHT = &H2
    Const ESB_DISABLE_UP = &H1
    Const ESB_DISABLE_DOWN = &H2
    Const ESB_DISABLE_LTUP = ESB_DISABLE_LEFT
    Const ESB_DISABLE_RTDN = ESB_DISABLE_RIGHTConst SIF_RANGE = &H1
    Const SIF_PAGE = &H2
    Const SIF_POS = &H4
    Const SIF_ALL = (SIF_RANGE Or SIF_PAGE Or SIF_POS)Private Type SCROLLINFO
        cbSize As Long
        fMask As Long
        nMin As Long
        nMax As Long
        nPage As Long
        nPos As Long
        nTrackPos As Long
    End Type
    Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
    Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    Private Declare Function InitializeFlatSB Lib "comctl32" (ByVal hWnd As Long) As Long
    Private Declare Function UninitializeFlatSB Lib "comctl32" (ByVal hWnd As Long) As Long
    Private Declare Function FlatSB_SetScrollProp Lib "comctl32" (ByVal hWnd As Long, ByVal index As Long, ByVal newValue As Long, ByVal fRedraw As Boolean) As Boolean
    Private Declare Function FlatSB_EnableScrollBar Lib "comctl32" (ByVal hWnd As Long, ByVal wSBflags As Long, ByVal wArrows As Long) As Long
    Private Declare Function FlatSB_GetScrollInfo Lib "comctl32" (ByVal hWnd As Long, ByVal fnBar As Long, lpsi As SCROLLINFO) As Boolean
    Private Declare Function FlatSB_GetScrollProp Lib "comctl32" (ByVal hWnd As Long, ByVal index As Long, pValue As Long) As Boolean
    Private Declare Function FlatSB_GetScrollRange Lib "comctl32" (ByVal hWnd As Long, ByVal code As Long, lpMinPos As Long, lpMaxPos As Long) As Boolean
    Private Declare Function FlatSB_SetScrollInfo Lib "comctl32" (ByVal hWnd As Long, ByVal fnBar As Long, lpsi As SCROLLINFO, ByVal fRedraw As Boolean) As Long
    Private Declare Function FlatSB_SetScrollPos Lib "comctl32" (ByVal hWnd As Long, ByVal code As Long, ByVal nPos As Long, ByVal fRedraw As Boolean) As Long
    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
    Private Sub Form_Activate()
        Dim SI As SCROLLINFO
        'Initialize
        InitializeFlatSB Me.hWnd
        'Set the vertical scrollbar to Encarta-mode
        FlatSB_SetScrollProp Me.hWnd, WSB_PROP_VSTYLE, FSB_ENCARTA_MODE, False
        'Disable the Up-button from the vertical scrollbar
        FlatSB_EnableScrollBar Me.hWnd, SB_VERT, ESB_DISABLE_UP
        'Set the vertical scroll range
        FlatSB_SetScrollRange Me.hWnd, SB_VERT, 20, 80, False
        'Set the scroll position to 50
        FlatSB_SetScrollPos Me.hWnd, SB_VERT, 60, False
        'Hide the horizontal scrollbar
        FlatSB_ShowScrollBar Me.hWnd, SB_HORZ, False
        'Get the scrollbar information
        SI.cbSize = Len(SI)
        SI.fMask = SIF_ALL
        FlatSB_GetScrollInfo Me.hWnd, SB_VERT, SI
        SI.nPos = SI.nPos - 10
        'Set the new scrollbar information
        FlatSB_SetScrollInfo Me.hWnd, SB_VERT, SI, True
        'Show some scrollbar information on the form
        Dim RetMin As Long, RetMax As Long
        FlatSB_GetScrollRange Me.hWnd, SB_VERT, RetMin, RetMax
        Me.AutoRedraw = True
        Me.Print "Scroll Position:" + Str$(Int(100 * (FlatSB_GetScrollPos(Me.hWnd, SB_VERT) / RetMax))) + "%"
        FlatSB_GetScrollProp Me.hWnd, WSB_PROP_VSTYLE, RetMin
        Me.Print "Vertical Scrollbar Mode:" + Str$(RetMin)
    End Sub
    Private Sub Form_Load()
        'KPD-Team 2000
        'URL: http://www.allapi.net/
        'E-Mail: [email protected]
        Dim Ret As Long
        'Create the scrollbars on the form
        Ret = GetWindowLong(Me.hWnd, GWL_STYLE)
        Ret = Ret Or WS_VSCROLL Or WS_HSCROLL
        SetWindowLong Me.hWnd, GWL_STYLE, Ret
    End Sub
    Private Sub Form_Unload(Cancel As Integer)
        'Remove the Flat style
        UninitializeFlatSB Me.hWnd
    End Sub
      

  3.   


    期待巴顿的控件,谢谢uguess's code
      

  4.   


    其实 就是吧原来的滚动条变成平面的    我在调试uguess's   code
      

  5.   


    发现友问题:
       使用滚动条以后,listview反而不能滚动了!清uguess帮忙!
      

  6.   

    mail:[email protected]@163.net都可以!!
      

  7.   

    去Microsoft.com查找Winless下载!
      

  8.   

    找到了,一个网友发了一个邮件给我!我贴出来!SYMPTOMS
    When using the FlatScrollBar in the ListView control you may run into one of the following problems: 
    If you check the FlatScrollBar property of the ListView in the IDE, you will not see a ScrollBar when you run the form. -or- 
    The FlatScrollBar does not appear to track properly on the ListView control. The control scrolls the columns properly, but the ScrollBar "thumb" position does not match. RESOLUTION
    For problem number 1, set the FlatScrollBar property for the ListView control in the form Activate instead of the IDE. There is no resolution for problem number 2 at this time. STATUS
    Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available. MORE INFORMATIONSteps to Reproduce Behavior
    Create a new Standard EXE project. Form1 is created by default. 
    Using the Projects menu, select Components to bring up the Components dialog box. On the Controls Tab, select "Microsoft Windows Common Controls 6.0," and then click OK. 
    Place a ListView and ImageList control on Form1. 
    Add four Images to the ImageList Control using the Images Tab of the ImageList control's Property Page. 
    In the Properties window, for the ListView control set the FlatScrollBar property to True. 
    Add the following code to Form1's code window:       Option Explicit      Private Sub Form_Activate()
          ' Uncomment the next line to show the scroll bar as Flat.
          ' For this to work you must make sure that you don't have
          ' FlatScrollBar set to True in the properties window of the ListView.
            'ListView1.FlatScrollBar = True
          End Sub      Private Sub Form_Load()
            Dim i As Integer
            Dim y As Integer
            y = 1        ' Add some items to the ListView control
            For i = 1 To 40
               ListView1.ListItems.Add Text:="test" & Str(i), Icon:=y
               y = y + 1
               If y = 5 Then y = 1
            Next i
          End Sub
     Save and run the project. You will not have a ScrollBar on the ListView control. 
    In the Properties window for the ListView control, set the FlatScrollBar property to False, and then uncomment the following line of code in the Form_Activate:       ListView1.FlatScrollBar = True
     Save and run the project. You now have a flat ScrollBar on the ListView control. 
    Try using the ScrollBar to scroll to the bottom of the ListView control. You will see the control scroll past the last items in the ListView and the ScrollBar will go to the bottom. But after you release the ScrollBar it will jump towards the top of the control, but you will still see the last items in the ListView control. Additional query words: kbDSupport kbDSD kbCtrl kbVBp kbVBp600bug Keywords : kbGrpVB 
    Version : 
    Platform : WINDOWS 
    Issue type : kbbug 
    Last Reviewed: January 5, 2000
    ? 2000 Microsoft Corporation. All rights reserved. Terms of Use.
      

  9.   

    但是,实际上是有缺点的!有个大的bug!滚动不正常!