|
Разместите на форме элемент ListBox. (В оригинале примера на форме был размещен элемент TreeView из библиотеки Microsoft Common Dialog Control 6.0. Можете разместить и его, только не забудьте снять комментарии, относящиеся к элементу TreeView). Private Const GWL_STYLE = (-16)
Private Const WS_HSCROLL = &H100000
Private Const WS_VSCROLL = &H200000
Private Declare Function GetWindowLong Lib "user32" Alias
"GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Sub Command1_Click()
Dim wndStyle As Long
wndStyle = GetWindowLong(List1.hwnd, GWL_STYLE)
'wndStyle = GetWindowLong(TreeView1.hwnd, GWL_STYLE)
If (wndStyle And WS_HSCROLL) <> 0 Then
MsgBox "A horizontal scroll bar is visible."
Else
MsgBox "A horizontal scroll bar is NOT visible."
End If
If (wndStyle And WS_VSCROLL) <> 0 Then
MsgBox "A vertical scroll bar is visible."
Else
MsgBox "A vertical scroll bar is NOT visible."
End If
End Sub
Private Sub Command2_Click()
List1.Move 250, 900, 1000, 1000
'TreeView1.Move 250, 900, 1000, 1000
End Sub
Private Sub Form_Load()
' Size and position the form and controls.
Form1.ScaleMode = 1
Form1.Move 0, 0, 5100, 5040
Command1.Caption = "Scroll Bar Test"
Command1.Move 120, 120, 1700, 500
Command2.Caption = "Size Control"
Command2.Move 2000, 120, 1700, 500
List1.Move 250, 900, 3000, 1500
'TreeView1.Move 250, 900, 3000, 1500
List1.AddItem "1: Sample Text"
List1.AddItem "2: Sample Text"
List1.AddItem "3: Sample Text"
List1.AddItem "4: Sample Text"
List1.AddItem "5: Sample Text"
List1.AddItem "6: Sample Text"
'TreeView1.Nodes.Add , , , "1: Sample Text"
'TreeView1.Nodes.Add , , , "2: Sample Text"
'TreeView1.Nodes.Add , , , "3: Sample Text"
'TreeView1.Nodes.Add , , , "4: Sample Text"
End Sub
|
|