哈哈,今天刚会,加comamnd1,text1,picture1 Private Declare Function ShowScrollBar Lib "user32" (ByVal hwnd As Long, ByVal wBar As Long, ByVal bShow As Long) As Long Private Sub Command1_Click() Select Case Text1.Text Case 0 ShowScrollBar Picture1.hwnd, 0, False '隐藏水平滚动条 ShowScrollBar Picture1.hwnd, 1, False '隐藏垂直滚动条 Case 1 ShowScrollBar Picture1.hwnd, 3, True ShowScrollBar Picture1.hwnd, 1, False Case 2 ShowScrollBar Picture1.hwnd, 3, True ShowScrollBar Picture1.hwnd, 0, False Case 3 ShowScrollBar Picture1.hwnd, 3, True End Select End Sub
好像理解错了?楼主是要用picture做控件?
要做个自己风格的滚动条呀 有move怎么实现呢?
那你就的在picture1的 MouseMove和MouseUp()同时满足条件然后执行代码!! Dim b As BooleanPrivate Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) b = True End SubPrivate Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If b = True Then '要执行的代码!! End If End SubPrivate Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) b = False End Sub
Private Declare Function ShowScrollBar Lib "user32" (ByVal hwnd As Long, ByVal wBar As Long, ByVal bShow As Long) As Long
Private Sub Command1_Click()
Select Case Text1.Text
Case 0
ShowScrollBar Picture1.hwnd, 0, False '隐藏水平滚动条
ShowScrollBar Picture1.hwnd, 1, False '隐藏垂直滚动条
Case 1
ShowScrollBar Picture1.hwnd, 3, True
ShowScrollBar Picture1.hwnd, 1, False
Case 2
ShowScrollBar Picture1.hwnd, 3, True
ShowScrollBar Picture1.hwnd, 0, False
Case 3
ShowScrollBar Picture1.hwnd, 3, True
End Select
End Sub
有move怎么实现呢?
MouseMove和MouseUp()同时满足条件然后执行代码!!
Dim b As BooleanPrivate Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
b = True
End SubPrivate Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If b = True Then
'要执行的代码!!
End If
End SubPrivate Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
b = False
End Sub