home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 2.00 Begin Form Misc BackColor = &H00C0C0C0& BorderStyle = 1 'Fixed Single Caption = "Miscellaneous Controls" ClientHeight = 5670 ClientLeft = 945 ClientTop = 915 ClientWidth = 8220 ClipControls = 0 'False Height = 6075 Icon = MISC.FRX:0000 Left = 885 LinkTopic = "Form2" MaxButton = 0 'False ScaleHeight = 378 ScaleMode = 3 'Pixel ScaleWidth = 548 Top = 570 Width = 8340 Begin SSPanel p2 BackColor = &H00C0C0C0& Caption = "p2" Font3D = 3 'Inset w/light shading Height = 4785 Left = 915 Outline = -1 'True RoundedCorners = 0 'False TabIndex = 13 Top = 495 Width = 7140 Begin SSPanel NewPages BackColor = &H00C0C0C0& BevelOuter = 1 'Inset BorderWidth = 6 Font3D = 3 'Inset w/light shading Height = 3855 Left = 120 RoundedCorners = 0 'False TabIndex = 44 Tag = "Pages" Top = 600 Width = 5775 Begin CommandButton newpage BackColor = &H00000000& Caption = "Create" Height = 375 Index = 0 Left = 3120 TabIndex = 54 Top = 2160 Width = 2055 End Begin CommandButton newpage BackColor = &H00000000& Caption = "Destroy" Height = 375 Index = 1 Left = 3120 TabIndex = 56 Top = 2760 Width = 2055 End Begin SSFrame Frame3D5 Caption = "Caption" Font3D = 3 'Inset w/light shading FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False ForeColor = &H00000000& Height = 975 Left = 2880 TabIndex = 51 Top = 720 Width = 2415 Begin TextBox newtag Height = 285 Left = 240 MaxLength = 13 TabIndex = 53 Top = 360 Width = 1935 End End Begin SSFrame Frame3D6 Caption = "Controls" Font3D = 3 'Inset w/light shading FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False ForeColor = &H00000000& Height = 2655 Left = 240 TabIndex = 48 Top = 720 Width = 2415 Begin SSCheck chk Caption = " Picturebox" Font3D = 0 'None Height = 255 Index = 3 Left = 240 TabIndex = 16 Top = 1995 Value = -1 'True Width = 1335 End Begin SSCheck chk Caption = " Checkboxes" Font3D = 0 'None Height = 255 Index = 2 Left = 240 TabIndex = 17 Top = 1680 Value = -1 'True Width = 1575 End Begin SSCheck chk Caption = " Caption Panel" Font3D = 0 'None Height = 255 Index = 1 Left = 240 TabIndex = 18 Top = 1320 Value = -1 'True Width = 1695 End Begin SSCheck chk Caption = " Textbox" Font3D = 0 'None Height = 255 Index = 0 Left = 240 TabIndex = 49 Top = 960 Value = -1 'True Width = 1335 End Begin Label Label2 BackStyle = 0 'Transparent Caption = "Include these controls on the new page:" FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 615 Left = 240 TabIndex = 60 Top = 360 Width = 1935 End End Begin SSPanel Panel3D5 BackColor = &H00C0C0C0& BevelOuter = 1 'Inset BorderWidth = 6 Caption = "Pages" Font3D = 3 'Inset w/light shading FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 13.5 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 375 Left = 240 RoundedCorners = 0 'False TabIndex = 45 Top = 120 Width = 5295 End End Begin SSPanel panel3d BackColor = &H00C0C0C0& BevelOuter = 1 'Inset Font3D = 3 'Inset w/light shading Height = 3855 Left = 360 TabIndex = 20 Tag = "Properties" Top = 3000 Width = 5775 Begin CommandButton Command1 BackColor = &H00000000& Caption = "Apply Now" Height = 375 Left = 1800 TabIndex = 33 Top = 2880 Width = 2175 End Begin SSPanel Panel3D1 BackColor = &H00C0C0C0& BevelOuter = 1 'Inset Caption = "Tab Control Properties" Font3D = 3 'Inset w/light shading FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 13.5 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 375 Left = 240 TabIndex = 32 Top = 120 Width = 5295 End Begin SSFrame Frame3D2 Caption = "Columns" Font3D = 3 'Inset w/light shading FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False ForeColor = &H00000000& Height = 1695 Left = 3240 TabIndex = 29 Top = 840 Width = 2175 Begin SSOption o1 Caption = " 3" Font3D = 0 'None Height = 255 Index = 1 Left = 360 TabIndex = 31 Top = 1080 Value = -1 'True Width = 1215 End Begin SSOption o1 Caption = " 2" Font3D = 0 'None Height = 255 Index = 0 Left = 360 TabIndex = 30 TabStop = 0 'False Top = 600 Width = 1215 End End Begin SSFrame f Caption = "Orientation" Font3D = 3 'Inset w/light shading FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False ForeColor = &H00000000& Height = 1695 Left = 360 TabIndex = 26 Top = 840 Width = 2175 Begin SSOption o Caption = "tabs down" Font3D = 0 'None Height = 255 Index = 1 Left = 240 TabIndex = 28 TabStop = 0 'False Top = 1080 Width = 1335 End Begin SSOption o Caption = "tabs up" Font3D = 0 'None Height = 255 Index = 0 Left = 240 TabIndex = 27 Top = 600 Value = -1 'True Width = 1335 End End End Begin PictureBox Generic BackColor = &H00C0C0C0& ClipControls = 0 'False Height = 3855 Index = 0 Left = 6360 ScaleHeight = 3825 ScaleWidth = 5745 TabIndex = 43 Tag = "Generic 0" Top = 1320 Width = 5775 Begin SSPanel gpanel BackColor = &H00C0C0C0& BevelOuter = 1 'Inset BorderWidth = 6 Caption = "Generic Page" Font3D = 3 'Inset w/light shading FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 13.5 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 375 Index = 0 Left = 480 RoundedCorners = 0 'False TabIndex = 47 Top = 240 Width = 4815 End Begin PictureBox gicon AutoSize = -1 'True BackColor = &H00C0C0C0& BorderStyle = 0 'None Height = 480 Index = 0 Left = 4680 Picture = MISC.FRX:0302 ScaleHeight = 480 ScaleWidth = 480 TabIndex = 52 Top = 840 Width = 480 End Begin CheckBox gCheck2 BackColor = &H00C0C0C0& Caption = "Check2" Height = 255 Index = 0 Left = 2400 TabIndex = 22 Top = 960 Width = 1095 End Begin CheckBox gcheck1 BackColor = &H00C0C0C0& Caption = "Check1" Height = 255 Index = 0 Left = 600 TabIndex = 23 Top = 960 Width = 1335 End Begin TextBox gtext2 Height = 1335 Index = 0 Left = 480 MultiLine = -1 'True ScrollBars = 2 'Vertical TabIndex = 46 Text = "Text2" Top = 2040 Width = 4815 End Begin TextBox gText1 Height = 285 Index = 0 Left = 480 TabIndex = 50 Text = "Text1" Top = 1560 Width = 4815 End End Begin CommonDialog cd CancelError = -1 'True DialogTitle = "Select a File" Filter = "*.ico;*.exe|*.ico;*.exe" InitDir = "c:\windows" Left = 6480 Top = 240 End Begin PictureBox tabbox BackColor = &H00C0C0C0& BorderStyle = 0 'None ClipControls = 0 'False Height = 495 Left = 0 ScaleHeight = 33 ScaleMode = 3 'Pixel ScaleWidth = 401 TabIndex = 14 Top = 0 Width = 6015 Begin PictureBox invbox AutoRedraw = -1 'True BackColor = &H00C0C0C0& BorderStyle = 0 'None ClipControls = 0 'False Height = 255 Left = 1800 ScaleHeight = 17 ScaleMode = 3 'Pixel ScaleWidth = 81 TabIndex = 15 Top = 120 Visible = 0 'False Width = 1215 End End Begin PictureBox IconPage BackColor = &H00FFFFFF& ClipControls = 0 'False Height = 3855 Index = 0 Left = 360 ScaleHeight = 255 ScaleMode = 3 'Pixel ScaleWidth = 383 TabIndex = 21 Tag = "Leaf Demo1" Top = 2400 Width = 5775 Begin PictureBox Leaf BorderStyle = 0 'None ClipControls = 0 'False FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 3735 Index = 0 Left = 0 ScaleHeight = 249 ScaleMode = 3 'Pixel ScaleWidth = 385 TabIndex = 24 Top = 375 Width = 5775 Begin PictureBox leafpic AutoSize = -1 'True BorderStyle = 0 'None ClipControls = 0 'False Height = 480 Index = 0 Left = 600 Picture = MISC.FRX:0604 ScaleHeight = 480 ScaleWidth = 480 TabIndex = 55 Top = 120 Visible = 0 'False Width = 480 End End Begin Label Label1 Caption = "Click 'New Leaf' to add leafs; 'New Item' to add items" FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 255 Left = 120 TabIndex = 59 Top = 90 Width = 3975 End Begin Line leafheader Index = 0 X1 = 0 X2 = 384 Y1 = 24 Y2 = 24 End Begin Label leaflabel2 BackStyle = 0 'Transparent Caption = "1 of 1" Height = 255 Left = 4800 TabIndex = 3 Top = 90 Width = 615 End Begin Label leaflabel1 Alignment = 1 'Right Justify BackStyle = 0 'Transparent Caption = "Leaf" Height = 255 Left = 4200 TabIndex = 25 Top = 90 Width = 495 End Begin Image leafcorner Height = 375 Left = 5400 Picture = MISC.FRX:0906 Top = 0 Width = 375 End End Begin SSPanel Panel3D2 BackColor = &H00C0C0C0& BevelOuter = 1 'Inset BorderWidth = 6 Font3D = 3 'Inset w/light shading FontBold = -1 'True FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 12 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 3855 Left = 480 RoundedCorners = 0 'False TabIndex = 34 Tag = "Captions" Top = 3240 Width = 5775 Begin SSFrame Frame3D4 Caption = "Font" Font3D = 3 'Inset w/light shading FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False ForeColor = &H00000000& Height = 2655 Left = 240 TabIndex = 19 Top = 720 Width = 2295 Begin ListBox List1 FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 2175 Left = 120 TabIndex = 36 Top = 360 Width = 2055 End End Begin SSFrame Frame3D3 Caption = "Captions" Font3D = 3 'Inset w/light shading FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False ForeColor = &H00000000& Height = 2055 Left = 2760 TabIndex = 38 Top = 720 Width = 2775 Begin TextBox Text1 Height = 285 Left = 120 MaxLength = 13 TabIndex = 40 Top = 1560 Width = 2535 End Begin ComboBox Combo1 Height = 300 Left = 120 Style = 2 'Dropdown List TabIndex = 39 Top = 600 Width = 2535 End Begin Label l BackStyle = 0 'Transparent Caption = "Text:" Height = 255 Index = 0 Left = 120 TabIndex = 42 Top = 1320 Width = 1215 End Begin Label Label7 BackStyle = 0 'Transparent Caption = "Tab:" Height = 255 Left = 120 TabIndex = 41 Top = 360 Width = 1455 End End Begin SSPanel Panel3D3 BackColor = &H00C0C0C0& BevelOuter = 1 'Inset BorderWidth = 6 Caption = "Tab Captions" Font3D = 3 'Inset w/light shading FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 13.5 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 375 Left = 240 RoundedCorners = 0 'False TabIndex = 37 Top = 120 Width = 5295 End Begin CommandButton Command3 BackColor = &H00000000& Caption = "Apply Now" Height = 375 Left = 3000 TabIndex = 35 Top = 3000 Width = 2295 End End Begin TextBox tbox BackColor = &H00C0C0C0& FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 3855 Left = 480 MultiLine = -1 'True ScrollBars = 2 'Vertical TabIndex = 12 Tag = "Intro" Top = 2760 Width = 5775 End End Begin PictureBox loader AutoRedraw = -1 'True AutoSize = -1 'True BorderStyle = 0 'None ClipControls = 0 'False Height = 480 Left = 7200 ScaleHeight = 32 ScaleMode = 3 'Pixel ScaleWidth = 32 TabIndex = 4 Top = 720 Visible = 0 'False Width = 480 End Begin SSPanel status Alignment = 0 'Left Justify - TOP BackColor = &H00C0C0C0& BevelInner = 1 'Inset Font3D = 3 'Inset w/light shading FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 375 Left = 0 Outline = -1 'True RoundedCorners = 0 'False TabIndex = 2 Top = 5280 Width = 6975 End Begin PictureBox picToolbar Align = 1 'Align Top BackColor = &H8000000F& ClipControls = 0 'False Height = 495 Left = 0 ScaleHeight = 465 ScaleWidth = 8190 TabIndex = 1 Top = 0 Width = 8220 Begin CommandButton newitem BackColor = &H00000000& Caption = "New Item" FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 330 Left = 3480 TabIndex = 58 Top = 60 Visible = 0 'False Width = 1095 End Begin CommandButton newleaf BackColor = &H00000000& Caption = "New Leaf" FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 330 Left = 2280 TabIndex = 57 Top = 60 Visible = 0 'False Width = 1095 End Begin Line Line6 BorderColor = &H00808080& X1 = 0 X2 = 7920 Y1 = 450 Y2 = 450 End Begin Line Line5 BorderColor = &H00FFFFFF& X1 = 0 X2 = 7920 Y1 = 0 Y2 = 0 End Begin Line Line4 BorderColor = &H00FFFFFF& X1 = 0 X2 = 0 Y1 = 0 Y2 = 480 End Begin Image i Height = 330 Index = 0 Left = 120 Picture = MISC.FRX:0B10 Top = 60 Width = 360 End Begin Image i Height = 330 Index = 1 Left = 480 Picture = MISC.FRX:0C92 Top = 60 Width = 360 End Begin Image i Height = 330 Index = 2 Left = 960 Picture = MISC.FRX:0E14 Top = 60 Width = 375 End Begin Image i Height = 330 Index = 3 Left = 1320 Picture = MISC.FRX:0FEE Top = 60 Width = 375 End Begin Image i Height = 330 Index = 4 Left = 1680 Picture = MISC.FRX:11C8 Top = 60 Width = 375 End End Begin SSPanel p1 BackColor = &H00C0C0C0& BevelInner = 2 'Raised BorderWidth = 6 Font3D = 3 'Inset w/light shading Height = 4785 Left = 0 Outline = -1 'True RoundedCorners = 0 'False TabIndex = 0 Top = 495 Width = 915 Begin SSCommand b Font3D = 0 'None Height = 615 Index = 6 Left = 150 RoundedCorners = 0 'False TabIndex = 11 Top = 3750 Width = 615 End Begin SSCommand b Font3D = 0 'None Height = 615 Index = 5 Left = 150 RoundedCorners = 0 'False TabIndex = 10 Top = 3150 Width = 615 End Begin SSCommand b Font3D = 0 'None Height = 615 Index = 4 Left = 150 RoundedCorners = 0 'False TabIndex = 9 Top = 2550 Width = 615 End Begin SSCommand b Font3D = 0 'None Height = 615 Index = 3 Left = 150 RoundedCorners = 0 'False TabIndex = 8 Top = 1950 Width = 615 End Begin SSCommand b Font3D = 0 'None Height = 615 Index = 2 Left = 150 Picture = MISC.FRX:13A2 RoundedCorners = 0 'False TabIndex = 7 Top = 1350 Width = 615 End Begin SSCommand b Font3D = 0 'None Height = 615 Index = 1 Left = 150 Picture = MISC.FRX:16A4 RoundedCorners = 0 'False TabIndex = 6 Top = 750 Width = 615 End Begin SSCommand b Font3D = 0 'None Height = 615 Index = 0 Left = 150 Picture = MISC.FRX:19A6 RoundedCorners = 0 'False TabIndex = 5 Top = 150 Width = 615 End Begin Image Image6 Height = 255 Index = 1 Left = 465 Picture = MISC.FRX:1CA8 Top = 4380 Width = 300 End Begin Image Image6 Height = 255 Index = 0 Left = 150 Picture = MISC.FRX:1DEE Top = 4380 Width = 300 End End Option Explicit Dim nl$ Dim page() As Control Dim tb As TabData 'used for new pages demo Const GWW_HINSTANCE = (-6) Declare Sub SetParent Lib "User" (ByVal hWndChild%, ByVal hWndNewParent%) 'used for leaf demo Dim lp As leafpage Dim pic() As Control Dim cap(0 To 7) As Control Declare Function GetWindowWord% Lib "User" (ByVal hWnd%, ByVal nIndex%) Declare Function ExtractIcon% Lib "shell.dll" (ByVal hisnt%, ByVal lpszExeName$, ByVal iIcon%) Declare Function DrawIcon% Lib "User" (ByVal hDC%, ByVal x%, ByVal y%, ByVal hIcon%) Sub Combo1_Click () text1 = combo1 End Sub Sub Command1_Click () If o(1).Value Then tb.orient = 1 Else tb.orient = 0 End If If o1(1).Value Then tb.cols = 3 Else tb.cols = 2 End If DefineControl Me, tabbox, invbox, page(), tb End Sub Sub Command3_Click () If text1 <> "" Then page(combo1.ListIndex).Tag = text1 End If DrawText tabbox, page(), tb End Sub Sub Form_Load () Dim s$ nl = Chr$(13) & Chr$(10) PlaceThings Initialize LoadText Move left, top, 7005, 5975 End Sub Sub Form_Resize () Dim i% If windowstate <> 1 Then TabResize Me, -1, -1, tabbox, invbox, page(), tb 'adjust the pages as you wish 'PageResize Me, -1, -1, page(), tb End If End Sub Function GetIcon (f As Form, file$, c As Control) Dim inst%, hIcon%, r% inst% = GetWindowWord(f.hWnd, GWW_HINSTANCE) hIcon% = ExtractIcon(inst%, file$, 0) If hIcon% > 1 Then 'no icons loader.Cls r% = DrawIcon(loader.hDC, 0, 0, hIcon) c.Picture = loader.Image GetIcon = -1 End If End Function Sub Initialize () Dim i%, numpages% numpages = 5 'set to highest index (total-1) '===create an array of controls======= ReDim page(0 To numpages) 'for this example, use an assortment of control types 'as the pages Set page(0) = tbox Set page(4) = IconPage(0) Set page(5) = generic(0) Set page(3) = NewPages Set page(1) = panel3d Set page(2) = panel3d2 '===fill in the fields of the struct===================== tb.num = numpages 'number of tabs tb.active = 0 'initial focus tb.cols = 3 'number of tabs in each row tb.orient = tabsup '0 = up, 1 = down 'if the tab control does not fill the form, you must 'define the size of the control '(note: width will be set to the tabbox width) tb.left = 15 tb.top = 15 tb.Height = p2.Height * 15 tb.Width = p2.Width * 15 - 30 'optional: tb.insetx = 120 tb.insety = 120 DefineControl Me, tabbox, invbox, page(), tb End Sub Sub leaf_paint (Index As Integer) Dim x%, y%, s$, lf% lf = Index * 8 For x = 0 To 3 For y = 0 To 1 's$ = lp.Caption(lp.active * 8 + y * 4 + x + 1) s$ = lp.Caption(lf + y * 4 + x + 1) If s <> "" Then leaf(Index).CurrentX = x * 80 + 26 leaf(Index).CurrentY = y * 112 + 56 leaf(Index).Print s End If Next: Next End Sub Sub leafcorner_Click () Dim n% n = lp.active + 1 If n > lp.numleafs Then n = 0 leaflabel2 = Format(n + 1) & " of " & Format(lp.numleafs + 1) leaf(n).ZOrder lp.active = n End Sub Sub leafpic_Click (Index As Integer) MsgBox "Item clicked." End Sub Sub List1_Click () tabbox.FontName = screen.Fonts(list1.ListIndex) End Sub Sub LoadText () Dim s$, i% If tb.orient Then o(1).Value = True For i = 0 To screen.FontCount - 1: list1.AddItem screen.Fonts(i): Next For i = 0 To tb.num: combo1.AddItem page(i).Tag: Next s$ = nl & nl & " This sample demonstrates the placement of the tab control on a form with other controls." s$ = s$ & nl & nl & " It also demonstrates an assortment of other variations on the control's usage." s = s & " It shows the use of multiple control types as the tab control's 'pages'." s = s & " It demonstrates the placement of the tabs on a container other than a form (e.g. a 3d panel)." s = s & " And it shows how to implement runtime property changes." s = s & nl & nl & " A couple of extra steps are required in this case." s$ = s$ & nl & nl & " 1. You must set the Left, Top, and Height properties before calling DefineControl(). If you do not set Width, it will default to the designtime width of the tabbox. Note that this differs from the case when all these values are 0, which defaults to the size of Page(). " s$ = s$ & nl & nl & " 2. You must handle resizing the tabbox and the pages if you place it on a resizable window. (Not supported and not recommended. I haven't tried it; extensive code modification may be required.)" s$ = s$ & nl & nl & " 3. You must assign controls to the page() array with individual Set statements for each page()." s$ = s$ & nl & nl & " 4. The tab control code only draws within the tabbox; if you wish to get a proper 3D effect, you must handle the additional drawing yourself. An early version of this sample used 6 Line controls to achieve consistency with the other controls. This worked fine but made design modifications a nightmare." s$ = s$ & " It now sits on a 3D panel." s = s & nl & nl & " This sample is fairly well junked up with dummy controls. It should give you some indication of how the performance of the code is affected by an increase in the number of controls on each page. The hit should be negligible, but notice that some combinations refresh more slowly, and flipping between light and dark backgrounds can be unpleasant." tbox = s End Sub Sub newitem_Click () If lp.num(lp.active) > 7 Then Beep: Exit Sub Dim r%, f$, x%, y% Dim position% On Error Resume Next cd.Action = 1 If Err = 32755 Then Exit Sub f$ = cd.Filename 'load a picturebox values: 1 to 32 lp.total = lp.total + 1: Debug.Print lp.total ReDim Preserve pic(1 To lp.total) Load leafpic(lp.total) Set pic(lp.total) = leafpic(lp.total) 'load a picture into it If Right$(cd.Filename, 3) = "ico" Then pic(lp.total).Picture = LoadPicture(f$) Else If Not GetIcon(Me, f$, pic(lp.total)) Then MsgBox "Cannot extract an icon from this file." pic(lp.total).Picture = leafpic(0).Picture End If End If 'set its parent SetParent pic(lp.total).hWnd, leaf(lp.active).hWnd 'increment number of items on this leaf 'values: 1 - 8 lp.num(lp.active) = lp.num(lp.active) + 1 Debug.Print lp.num(lp.active) 'each position has a unique index, remember what's there 'values: 1 - 32 position% = lp.active * 8 + lp.num(lp.active) Debug.Print position lp.item(position) = lp.total 'save the caption lp.Caption(position) = LCase(cd.Filetitle) 'move the pic into position y = ((lp.num(lp.active) - 1) \ 4) * 112 + 16 Debug.Print y x = ((lp.num(lp.active) - 1) Mod 4) * 80 + 40 Debug.Print x pic(lp.total).Move x, y pic(lp.total).Visible = -1 leaf_paint lp.active End Sub Sub newleaf_Click () Dim n% If lp.numleafs > 2 Then Beep: Exit Sub lp.numleafs = lp.numleafs + 1 n = lp.numleafs Load leaf(n) leaflabel2 = Format(n + 1) & " of " & Format(lp.numleafs + 1) leaf(n).Visible = -1 leaf(n).ZOrder lp.active = n If n > 2 Then newleaf.Enabled = 0 End Sub Sub newpage_Click (Index As Integer) Static n% If Index = 0 Then 'create a page If n > 3 Then Beep: Exit Sub n = n + 1 Load generic(n) If newtag = "" Then generic(n).Tag = "Generic" & Format(n) generic(n).Tag = newtag End If If chk(0).Value Then Load gtext1(n) SetParent gtext1(n).hWnd, generic(n).hWnd gtext1(n).Visible = -1 Load gtext2(n) SetParent gtext2(n).hWnd, generic(n).hWnd gtext2(n).Visible = -1 End If If chk(1).Value Then Load gpanel(n) SetParent gpanel(n).hWnd, generic(n).hWnd gpanel(n).Caption = "Generic Page " & Format(n) gpanel(n).Visible = -1 End If If chk(2).Value Then Load gcheck1(n) SetParent gcheck1(n).hWnd, generic(n).hWnd gcheck1(n).Visible = -1 Load gcheck2(n) SetParent gcheck2(n).hWnd, generic(n).hWnd gcheck2(n).Visible = -1 End If If chk(3).Value Then Load gicon(n) SetParent gicon(n).hWnd, generic(n).hWnd gicon(n).Visible = -1 End If 'add to the pages array tb.num = tb.num + 1 ReDim Preserve page(0 To tb.num) Set page(tb.num) = generic(n) If tb.cols < 5 Then tb.cols = 5 generic(n).Visible = -1 DefineControl Me, tabbox, invbox, page(), tb Else 'destroy last page If n = 0 Then Beep: Exit Sub n = n - 1 tb.num = tb.num - 1 ReDim Preserve page(0 To tb.num) Unload generic(n + 1) If n = 0 Then tb.cols = 3 DefineControl Me, tabbox, invbox, page(), tb End If End Sub Sub PlaceThings () p1.Move 0, 33, 61, 319 p2.Move 61, 33, 404, 319 status.Move 0, 352, 465, 25 End Sub Sub tabbox_MouseUp (Button As Integer, Shift As Integer, x As Single, y As Single) TabClick Button, x, y, tabbox, page(), tb If tb.active = 4 Then newleaf.Visible = -1 newitem.Visible = -1 newleaf.Visible = 0 newitem.Visible = 0 End If End Sub Sub tabbox_Paint () DrawText tabbox, page(), tb End Sub Sub Text1_KeyPress (keyascii As Integer) If keyascii = 13 Then command3.Value = -1 keyascii = 0 End If End Sub