偶的使d办的,only one可以mail吗?[email protected]我得目的使:上述三个控件能构在 不添加别的控件的基础上原有的滚动条变成平面不知道sendmessage可以实现吗?或者用vb自己的只有控件???
解决方案 »
- 国庆放分100,顺问一个文件上传的问题
- 看完VB,我仍在谷底,有高手带我到山顶俯瞰下这VB山谷么?高手指教,低手帮顶 谢谢啊
- 怎样在Data Report的表格中打印图片
- 刚才基础版有人问传入窗体,操作数据库表的问题,来,交流一下(反正有段时间不能来了,给大家留点东西)
- 如何动态创建控件
- 高分求解,给报表传值的问题,(DATAREPORT)
- 兄弟刚刚接手一个医药行业专用发票软件的开发,其发票开具部分界面与财务的普通记帐凭证极为相似,请问如何设置(控件、思路……)
- DCOM编程项目合作伙伴
- 如何用VB关闭网络上的计算机
- 如何编写简单的代理服务器程序?
- 关于COM组件的编写!
- 急!为什么我的savepicture命令不能用?在线等待!
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
期待巴顿的控件,谢谢uguess's code
其实 就是吧原来的滚动条变成平面的 我在调试uguess's code
发现友问题:
使用滚动条以后,listview反而不能滚动了!清uguess帮忙!
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.