home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "Global"
- Option Explicit
- Public Const VBVer = "5.0"
- Public Const LastAppUpdate = "9/4/96"
-
- Public Const WM_SYSCOMMAND = &H112
- Public Const SC_RESTORE = &HF120
- Public Const SWP_NOMOVE = 2
- Public Const SWP_NOSIZE = 1
- Public Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
- Public Const HWND_TOPMOST = -1
- Public Const HWND_NOTOPMOST = -2
-
- Public Const WM_SETREDRAW = &HB
-
- ' ┤┤╜¿╟░╢╦┤░┐┌╡─ Windows API ╡≈╙├
- Declare Function SetWindowPos Lib "User32" (ByVal h&, ByVal hb&, ByVal x&, ByVal y&, ByVal cx&, ByVal cy&, ByVal f&) As Long
- Declare Function FindWindow Lib "User32" (ByVal lpClassName As Any, ByVal lpWindowName As Any) As Long
- Declare Function SendMessage Lib "User32" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
-
- Declare Function SetParent Lib "User32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
-
- Type BookAuthor
- ID As Integer
- Name As String * 25
- End Type
-
- Dim arDemos(20) As String
-
- Public Function SetRedraw(hWnd As Long, lState As Long) As Long
-
- Dim lRetVal As Long
-
- On Error GoTo SetRedraw_Error
- ' Set iState = 0 ╜√╓╣╫╘╢»╕ⁿ╨┬
- ' Set iState = 1 ╘╩╨φ╫╘╢»╕ⁿ╨┬
- lRetVal = SendMessage(hWnd, WM_SETREDRAW, lState, 0)
- If lRetVal <> False Then GoTo SetRedraw_Error
-
- SetRedraw = True
- Exit Function
-
- SetRedraw_Error:
- SetRedraw = lRetVal
- Exit Function
-
- End Function
-
- Public Function SetTopWindow(hWnd As Long, bState As Boolean) As Boolean
-
- If bState = True Then '┤░╠σ╓├╙┌╟░╢╦
- SetTopWindow = SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
- ElseIf bState = False Then ' ╣╪▒╒ TopMost ▒Ω╓╛
- SetTopWindow = SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)
- Else
- Debug.Print "bState ╬┤╓¬íú"
- SetTopWindow = False
- End If
-
- End Function
-
- ' ╜½┤½╡▌╡─┤░╠σ╢╘╧≤╓├╙┌╓╨╨─
- Sub CenterMe(frmForm As Form)
- frmForm.Left = (Screen.Width - frmForm.Width) / 2
- frmForm.Top = (Screen.Height - frmForm.Height) / 2
- End Sub
-
- Sub Main()
- Dim iCount As Integer
- Dim iLimit As Integer
- Dim tvwSample As TreeView
- Dim nodRoot As Node
- Dim nodX As Node
- Dim sLastParent As String
- Dim ilImages As ListImages
- Dim iNextParentImage As Integer
-
- Set tvwSample = frmExplore.tvExample
- Set ilImages = frmExplore.ilExplore.ListImages
-
- frmExplore.Show
-
- ' ╧╘╩╛╦┘╢╚└α▒≡
- arDemos(0) = "╦π╖¿"
- arDemos(1) = "╧╘╩╛╦┘╢╚"
- arDemos(2) = "╗µ╓╞═╝╞¼"
- arDemos(3) = "╧╘╩╛╦┘╢╚"
- arDemos(4) = "═╝╨╬"
- arDemos(5) = "╧╘╩╛╦┘╢╚"
-
- ' ╒µ╩╡╦┘╢╚└α▒≡
- arDemos(6) = "╫╓╖√┤«┤ª└φ"
- arDemos(7) = "╒µ╩╡╦┘╢╚"
- arDemos(8) = "┤·┬δ╙┼╗»"
- arDemos(9) = "╒µ╩╡╦┘╢╚"
- arDemos(10) = "╩²╓╡└α╨═"
- arDemos(11) = "╒µ╩╡╦┘╢╚"
-
- ' ╫╩╘┤╙├╖¿└α▒≡
- arDemos(12) = "Picture ╢╘ Image"
- arDemos(13) = "╫╩╘┤╙├╖¿"
- arDemos(14) = "│╖╧√┤░╠σ╢╘╧≤"
- arDemos(15) = "╫╩╘┤╙├╖¿"
-
- ' ╩╙╛⌡╦┘╢╚└α▒≡
- arDemos(16) = "╔┴╧╓╞┴─╗"
- arDemos(17) = "╩╙╛⌡╦┘╢╚"
-
- ' ╝»║╧└α▒≡
- arDemos(18) = "╝»║╧"
- arDemos(19) = "╝»║╧"
-
- Set nodRoot = tvwSample.Nodes.Add(, , "Root", "╙┼╗»╩╛└²")
- nodRoot.Image = 1
- iNextParentImage = 2
- '╜¿┴ó╡┌╥╗╕÷ Demo └α╨═
- '┤╙ Root ┤┤╜¿╥╗╕÷ Demo └α╨═ú¼▓ó╩╣╞Σ│╔╬¬ Root ╡─╫╙╜┌╡πíú
- iCount = 0
- sLastParent = arDemos(iCount + 1)
- Set nodX = tvwSample.Nodes.Add("Root", tvwChild, sLastParent, arDemos(iCount + 1))
- nodX.Image = iNextParentImage '╧╘╩╛╦┘╢╚
- iNextParentImage = iNextParentImage + 1
- '╩╣╕├╜┌╡π│╔╬¬╔╧╥╗╕÷ Demo └α╨═╡─╫╙╜┌╡π
- Set nodX = tvwSample.Nodes.Add(sLastParent, tvwChild, , arDemos(iCount))
- nodX.Image = 7
- iLimit = UBound(arDemos)
- For iCount = 2 To iLimit - 1 Step 2
- If arDemos(iCount + 1) <> arDemos(iCount - 1) Then
- nodX.EnsureVisible ' ╚╖▒ú╫ε║≤╫Θ╓╨╡─╦∙╙╨╫╙┤░╠σ┐╔╝√
- '┤╙ Root ┤┤╜¿╥╗╕÷ Demo └α╨═ú¼▓ó╩╣╞Σ│╔╬¬ Root ╡─╫╙╜┌╡πíú
- sLastParent = arDemos(iCount + 1)
- Set nodX = tvwSample.Nodes.Add("Root", tvwChild, sLastParent, arDemos(iCount + 1))
- nodX.Image = iNextParentImage
- iNextParentImage = iNextParentImage + 1
- End If
- '╩╣╕├╜┌╡π│╔╬¬╔╧╥╗╕÷ Demo └α╨═╡─╫╙╜┌╡π
- Set nodX = tvwSample.Nodes.Add(sLastParent, tvwChild, , arDemos(iCount))
- nodX.Image = 7
- Next iCount
-
- nodX.EnsureVisible
-
- ' │╖╧√╦∙╙╨╥╤╛¡┤┤╜¿╡─╢╘╧≤
- Set nodX = Nothing
- Set nodRoot = Nothing
- Set ilImages = Nothing
- Set tvwSample = Nothing
-
- End Sub
-
- Sub PosForm(frmForm As Form)
- frmForm.Left = frmExplore.Left + frmExplore.Width
- frmForm.Top = frmExplore.Top
- End Sub
-
-
-