home *** CD-ROM | disk | FTP | other *** search
- ***************** D:\VB_APPS\ELASTIC\MULTITAB.FRM *****************
- Sub Button_Click (Index As Integer)
- Dim i%
-
- Select Case Index
-
- Case 1 'Changes tab styles
- VSIndexTab1.Style = (VSIndexTab1.Style + 1) Mod 6
-
-
- Case 2 'Changes back tab color
- VSIndexTab1.BackTabColor = QBColor(Rnd * 15)
- VSIndexTab1.Refresh
-
-
- Case 3 'Changes Caption text color
- VSIndexTab1.ForeColor = QBColor(Rnd * 15)
-
-
- Case 4 'Changes BackSheets style
- VSIndexTab1.MultiRow = Not VSIndexTab1.MultiRow
-
-
- End Select
-
- End Sub
-
- Sub Form_Load ()
- Dim i%, x%, y%
- For i = 1 To 3
- TabsPerPage.AddItem Str$(i)
- Next i
- TabsPerPage.ListIndex = 0
-
- 'Unique Colors for each tab
- VSIndexTab2.TabColor(0) = &H80FF80
- VSIndexTab2.TabColor(1) = &H80FFFF
- VSIndexTab2.TabColor(2) = &HFFFF80
-
- 'Fill up Grid
- Grid1.Col = 0
- For x = 1 To 15
- Grid1.Row = x
- Grid1.Text = x
- Next x
- Grid1.Row = 0
- For x = 1 To 15
- Grid1.Col = x
- Grid1.Text = x
- Next x
- End Sub
-
- Sub List1_MouseDown (Index%, Button As Integer, Shift As Integer, x As Single, y As Single)
-
- End Sub
-
- Sub Mode_Click (Index As Integer)
- VSIndexTab1.MultiRow = Not VSIndexTab1.MultiRow
- End Sub
-
- Sub TabsPerPage_Click ()
- VSIndexTab1.TabsPerPage = TabsPerPage.ListIndex + 1
- VSIndexTab1.FirstTab = 6 - VSIndexTab1.TabsPerPage
-
- End Sub
-
- Sub Text3_MouseDown (Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
-
- End Sub
-
- ***************** D:\VB_APPS\ELASTIC\BROWSER.FRM *****************
- Sub Command1_Click (Index%)
- Select Case Index
-
- Case 0 'Open Button
- ' get file name
- cmdialog.DialogTitle = "Open VB Project"
- cmdialog.Filename = ""
- cmdialog.DefaultExt = "MAK"
- cmdialog.Filter = "VB Projects (*.mak)|*.MAK|All Files (*.*)|*.*"
- cmdialog.Flags = &H1800&
- cmdialog.Action = 1
- If cmdialog.Filename = "" Then Exit Sub
-
- ' read project
- text1 = ""
- vsawk1.FileName = cmdialog.Filename
- vsawk1.Tag = Left(cmdialog.Filename, Len(cmdialog.Filename) - Len(cmdialog.Filetitle))
- vsawk1.Action = 0
- vselastic3.FloodPercent = 0
- vselastic3 = "Ready"
-
-
- Case 1 ' Clipboard
- If text1 = "" Then MsgBox "Sorry, no code selected.", 16: Exit Sub
- clipboard.SetText text1, 1
- vselastic3 = "Code copied to clipboard"
-
- Case 2 'Print
- MsgBox "Print routine not implemented", 64
-
- End Select
- End Sub
-
- Sub Command1_MouseMove (Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
-
- If OldTip = Index Then Exit Sub
- ToolTip.Caption = Command1(Index).Tag
- ToolTip.Width = TextWidth(Command1(Index).Tag)
- ToolTip.Move Command1(Index).Left + Command1(Index).Height * .75, Command1(Index).Top + Command1(Index).Height * 1.1
- ToolTip.Visible = True
-
- OldTip = Index
-
- End Sub
-
- Sub List2_DblClick ()
-
- vsawk3 = list2
- vsawk3.FileName = vsawk3.F(3)
- vsawk3.Tag = Val(vsawk3.F(4))
- vsawk3.Action = 0
-
- End Sub
-
- Sub VSAwk1_Begin ()
- mousepointer = 11
- list1.Clear
- End Sub
-
- Sub VSAwk1_End ()
- Dim i%
-
- list2.Clear
- For i = 0 To list1.ListCount - 1
- list1.ListIndex = i
- vsawk2.FileName = list1.List(i)
- vselastic3 = vsawk2.FileName
- vsawk2.Action = 0
- list2.Refresh
- Next
-
- End Sub
-
- Sub VSAwk1_Scan ()
- 'add .FRM files to List1
- If InStr(vsawk1, "=") > 0 Or InStr(vsawk1, "VBX") > 0 Then Exit Sub
- If InStr(vsawk1, "\") > 0 Then
- list1.AddItem vsawk1
- Else
- list1.AddItem vsawk1.Tag + vsawk1
- End If
-
- End Sub
-
- Sub VSAwk2_End ()
- mousepointer = 0
- End Sub
-
- Sub VSAwk2_Scan ()
- Static insub%, a$, lp%
-
- If vsawk2.PercentDone <> lp Then
- lp = vsawk2.PercentDone
- vselastic3.FloodPercent = lp
- DoEvents
- End If
-
- '=====================================================
- 'Search for subroutines/Functions/Variable definitions
- '=====================================================
- If vsawk2.F(1) = "Sub" Then
- insub = True
- a = vsawk2.F(2) + Chr(9) + "(sub)" + Chr(9) + vsawk2.FileName + Chr(9) + Format(vsawk2.CurrPos)
- list2.AddItem a
- Exit Sub
- End If
-
- If vsawk2.F(1) = "Function" Then
- insub = True
- a = vsawk2.F(2) + Chr(9) + "(fun)" + Chr(9) + vsawk2.FileName + Chr(9) + Format(vsawk2.CurrPos)
- list2.AddItem a
- Exit Sub
- End If
-
- If vsawk2.F(1) = "Global" And vsawk2.F(2) <> "Const" Then
- a = vsawk2.F(2) + Chr(9) + "(gvar)" + Chr(9) + vsawk2.FileName + Chr(9) + Format(vsawk2.CurrPos)
- list2.AddItem a
- Exit Sub
- End If
-
- If vsawk2.F(1) = "Dim" And Not insub Then
- a = vsawk2.F(2) + Chr(9) + "(fvar)" + Chr(9) + vsawk2.FileName + Chr(9) + Format(vsawk2.CurrPos)
- list2.AddItem a
- Exit Sub
- End If
-
- If vsawk2.F(1) = "End" And (vsawk2.F(2) = "Sub" Or vsawk2.F(2) = "Function") Then
- insub = False
- Exit Sub
- End If
-
- End Sub
-
- Sub VSAwk3_Begin ()
-
- mousepointer = 11
- vsawk3.CurrPos = Val(vsawk3.Tag)
- subtext = ""
-
- End Sub
-
- Sub VSAwk3_End ()
-
- text1 = subtext
- mousepointer = 0
- End Sub
-
- Sub VSAwk3_Scan ()
-
- ' accumulate text
- If subtext = "" Then
- subtext = vsawk3
- Else
- subtext = subtext + Chr(13) + Chr(10) + vsawk3
- End If
-
- ' stop if only a var
- If vsawk3.RN = 0 Then
- If vsawk3.F(1) <> "Sub" And vsawk3.F(1) <> "Function" Then vsawk3.Action = 2
- End If
-
- ' stop at end of functions and subs
- If vsawk3.F(1) = "End" Then
- If vsawk3.F(2) = "Sub" Then vsawk3.Action = 2
- If vsawk3.F(2) = "Function" Then vsawk3.Action = 2
- End If
-
- End Sub
-
- Sub VSElastic1_MouseMove (Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
- OldTip = -1
- ToolTip.Visible = False
- End Sub
-
- ***************** D:\VB_APPS\ELASTIC\FPROP.FRM *****************
- Sub Command1_Click ()
- MsgBox "This is done with only one elastic that fills the container and its AutoSizeChildren property set to proportional"
- End Sub
-
- Sub Form_Load ()
- oh = vselastic1.Height
- End Sub
-
- Sub Form_Resize ()
- 'Code to Change fonts when form is resized
- Dim I%
- On Error Resume Next
-
- If check1.Value Then Exit Sub
-
- For I = 0 To Controls.Count - 1
- Controls(I).FontSize = 12 * (vselastic1.Height / oh)
- Controls(I).FontName = "Arial"
- Next I
- 'oh = vselastic1.Height
-
- End Sub
-
- ***************** D:\VB_APPS\ELASTIC\FNOLABEL.FRM *****************
- Sub Command1_Click (Index As Integer)
- Select Case Index
-
- Case 0 'Change Caption Positions
- VSElastic1.CaptionPos = (VSElastic1.CaptionPos + 1) Mod 9
-
- Case 1 'Change to random colors
- VSElastic1.ForeColor = QBColor(Rnd * 15)
-
- Case 2
- MsgBox "Check the Tag property of the text boxes and the TagWidth and TagPosition properties of the Elastic"
-
- Case 3 'Shadows
- VSElastic1.ShadowColor = QBColor(Rnd * 15)
-
- Case 4 'TagPosition
- VSElastic4.TagPosition = (VSElastic4.TagPosition + 1) Mod 2
-
- End Select
- End Sub
-
- Sub Text_DragDrop (Index As Integer, source As Control, X As Single, Y As Single)
- If source.Left > Text(Index).Left Then
- source.Left = Text(Index).Left - 50
- Else
- source.Left = Text(Index).Left + 50
- End If
- End Sub
-
- Sub Text_MouseDown (Index As Integer, button As Integer, Shift As Integer, X As Single, Y As Single)
- If button = 2 Then Text(Index).Drag 1
- End Sub
-
- ***************** D:\VB_APPS\ELASTIC\FBUTTONS.FRM *****************
- Sub Image1_MouseDown (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
- VSElastic2(Index).BevelOuter = 4
- End Sub
-
- Sub Image1_MouseUp (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
- VSElastic2(Index).BevelOuter = 2
- End Sub
-
- Sub Image2_Click (Index As Integer)
- If VSElastic3(Index).BevelOuter = 2 Then
- VSElastic3(Index).BevelOuter = 4
- Else
- VSElastic3(Index).BevelOuter = 2
- End If
-
- End Sub
-
- Sub VSElastic2_MouseDown (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
- VSElastic2(Index).BevelOuter = 4
- End Sub
-
- Sub VSElastic2_MouseUp (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
- VSElastic2(Index).BevelOuter = 2
- End Sub
-
- Sub VSElastic3_Click (Index As Integer)
- If VSElastic3(Index).BevelOuter = 2 Then
- VSElastic3(Index).BevelOuter = 4
- Else
- VSElastic3(Index).BevelOuter = 2
- End If
-
- End Sub
-
- ***************** D:\VB_APPS\ELASTIC\CALCULAT.FRM *****************
- Sub Awk_Variable (Variable As String, Value As Single, Accept As Integer)
- Accept% = True
- Select Case Variable$
- Case "A", "a": Value! = Val(Memory(0))
- Case "B", "b": Value! = Val(Memory(1))
- Case "C", "c": Value! = Val(Memory(2))
- Case "D", "d": Value! = Val(Memory(3))
- Case "E", "e": Value! = Val(Memory(4))
- Case "F", "f": Value! = Val(Memory(5))
- Case Else: Accept% = False ' refuse garbage
- End Select
- End Sub
-
- Sub Enter_Click ()
- Dim a$
-
- awk = Formula
- a = Format(awk.Val)
- Select Case awk.Error
- Case 6: a = "Bad Syntax"
- Case 7: a = "Bad Variable"
- Case 8: a = "Missing Bracket"
- Case 9: a = "Div by Zero"
- End Select
- Results = Formula + " = " + Chr(13) + Chr(10) + a + " " + Chr(13) + Chr(10) + Chr(13) + Chr(10) + Results
-
- End Sub
-
- Sub Form_KeyPress (KeyAscii As Integer)
- If KeyAscii <> 13 Then Exit Sub
- KeyAscii = 0
- Enter_Click
- End Sub
-
- Sub Formula_GotFocus ()
- Formula.SelStart = 0
- Formula.SelLength = 30000
- End Sub
-
- Sub Memory_GotFocus (Index As Integer)
- Memory(Index).SelStart = 0
- Memory(Index).SelLength = 30000
- Memory(Index).FontBold = True
- End Sub
-
- Sub Memory_LostFocus (Index As Integer)
- Memory(Index) = Format(Val(Memory(Index))) + " "
- Memory(Index).FontBold = False
- End Sub
-
- Sub Results_DblClick ()
- Results = ""
- End Sub
-
- ***************** D:\VB_APPS\ELASTIC\FLOOD.FRM *****************
- Sub Timer1_Timer ()
- Dim j%
- Static i%
-
- If i > 97 Then i = 0
- i = i + 3
-
- For j = 0 To 3
- flood(j).FloodPercent = i
- flood(j).Caption = i & "%"
- Next j
-
- End Sub
-
- ***************** D:\VB_APPS\ELASTIC\SPLITTER.FRM *****************
- Sub Command1_Click (Index As Integer)
- Dim newcolor&
- Select Case Index
-
- Case 0 'Change to random colors
- newcolor = QBColor(Rnd * 15)
- MainElastic.BackColor = newcolor
- RightElastic.BackColor = newcolor
-
- Case 1 'Fonts
- Text1.FontSize = (Text1.FontSize + 2) Mod 13
- Text2.FontSize = (Text2.FontSize + 2) Mod 13
-
- End Select
- End Sub
-
- ***************** D:\VB_APPS\ELASTIC\INDEXTAB.FRM *****************
- Sub Btn_Click (Index As Integer)
- Select Case Index
- Case 0 'Changes Tab positions
- VSIndexTab.Position = (VSIndexTab.Position + 1) Mod 5
-
- Case 1 'Changes tab styles
- VSIndexTab.Style = (VSIndexTab.Style + 1) Mod 8
-
- Case 2 'Changes back tab color
- ' disable pictures
- Dim i%
- Check1(3).Value = 0
- For i = 0 To 2
- VSIndexTab.TabPicture(i) = Image1(3)
- Next
- VSIndexTab.BackTabColor = QBColor(Rnd * 15)
-
- Case 3 'Changes Caption text color
- VSIndexTab.ForeColor = QBColor(Rnd * 15)
-
- Case 4 'Cool
- MsgBox "Click VideoSoft Address with the right button, drag it to Notes tab, and drop it in one of the List boxes. WAY COOL!!"
-
- End Select
-
- End Sub
-
- Sub Btn_MouseMove (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
- If OldTip = Index Then Exit Sub
- ToolTip.Visible = True
- ToolTip.Caption = Btn(Index).Tag
- ToolTip.Width = TextWidth(Btn(Index).Tag)
- ToolTip.Move Btn(Index).Left + Btn(Index).Height * .75, StatusBar(0).Top + Btn(Index).Top + Btn(Index).Height * 1.1
- OldTip = Index
- End Sub
-
- Sub btn_Shadow_Click (Index%)
- Select Case Index
- Case 0
- Page(2).ShadowColor = QBColor(Rnd * 15)
- Case 1
- VSIndexTab.FrontTabForeColor = QBColor(Rnd * 15)
- End Select
- End Sub
-
- Sub Button_Click (Index As Integer)
- End Sub
-
- Sub Button_MouseMove (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
-
- End Sub
-
- Sub Check1_click (Index%)
- Dim i%
-
- Select Case Index
-
- Case 0 'BoldCurrentTab
- VSIndexTab.BoldCurrent = Not VSIndexTab.BoldCurrent
-
- Case 1 'Enable/Disable Notes Tab
- VSIndexTab.TabEnabled(1) = Not VSIndexTab.TabEnabled(1)
- VSIndexTab.Refresh
-
- Case 2 'Shadows
- If Check1(2).Value = 0 Then
- Page(2).BevelInnerWidth = 1
- Page(2).BevelInner = 3 'Inset
- Else
- Page(2).BevelInnerWidth = 4
- Page(2).BevelInner = 7 'Shadows
- End If
-
- Case 3 'Pictures
- If Check1(3).Value = 1 Then
- For i = 0 To 2
- VSIndexTab.TabPicture(i) = Image1(i)
- Next
- VSIndexTab.BackTabColor = &HC0C0C0
- Else
- For i = 0 To 2
- VSIndexTab.TabPicture(i) = Image1(3)
- Next
- End If
-
- Case 4 'DogEars
- VSIndexTab.DogEars = Not VSIndexTab.DogEars
-
- End Select
- End Sub
-
- Sub Form_Load ()
- '============================================================
- ' To create an IndexTab at design time
- '============================================================
- ' * Place an IndexTab on your form
- ' * Set the Autoswitch to False
- ' * Set the Caption for tabs separated by a pipe (One|Two)
- ' * Place one container (Elastic or PictureBox) per tab on
- ' the white area of the indextab. The containers should
- ' not touch each other.
- ' * Set the Autoswitch to False
- ' * Double click with the right mouse on the tab to
- ' populate the controls
- '============================================================
- Me.Caption = "VideoSoft Indextab"
-
- 'Fill lists and Combox
- TabsPerPage.AddItem "1"
- TabsPerPage.AddItem "2"
- TabsPerPage.AddItem "3"
- TabsPerPage.ListIndex = 2
-
- Combo1.AddItem "VideoSoft"
- Combo1.ListIndex = 0
-
- ' show pictures
- Check1_click 3
-
- Grid1.Row = 0
- Grid1.Col = 0
- Grid1.ColWidth(0) = 1000
- Grid1.Text = "Prod ID"
- Grid1.Col = 1
- Grid1.ColWidth(1) = 2500
- Grid1.Text = "Description"
- Grid1.Col = 2
- Grid1.Text = "Qty"
- Grid1.Col = 3
- Grid1.ColWidth(3) = 4500
- Grid1.Text = "Price"
-
- End Sub
-
- Sub Form_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
- ToolTip.Visible = False
- End Sub
-
- Sub Label3_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
- If Button = 2 Then Label3.Drag 1
- End Sub
-
- Sub List1_DragDrop (Index As Integer, Source As Control, X As Single, Y As Single)
- List1(Index).AddItem Source
-
- End Sub
-
- Sub MainElastic_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
- ToolTip.Visible = False
- OldTip = -1
- End Sub
-
- Sub StatusBar_MouseMove (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
- ToolTip.Visible = False
- OldTip = -1
- End Sub
-
- Sub TabsPerPage_Click ()
-
- VSIndexTab.TabsPerPage = TabsPerPage.ListIndex + 1
- VSIndexTab.FirstTab = 3 - VSIndexTab.TabsPerPage
-
- 'Enable DogEars option
- If VSIndexTab.TabsPerPage = 3 Then
- Check1(4).Enabled = False
- Else
- Check1(4).Enabled = True
- End If
- End Sub
-
- Sub Text1_MouseDown (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
- If Button = 2 Then Text1(Index).Drag 1
- End Sub
-
- Sub VSIndexTab_DragOver (Source As Control, X As Single, Y As Single, State As Integer)
- If VSIndexTab.MouseOver <> -1 Then VSIndexTab.CurrTab = VSIndexTab.MouseOver
- End Sub
-
- Sub VSIndexTab_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
- ToolTip.Visible = False
-
- On Error Resume Next
-
- If VSIndexTab.MouseOver = -1 Then
- ' Current page
- If StatusBar(1) <> "Current Page" Then StatusBar(1) = "Current Page"
- Else
- ' Move Over other page
- If StatusBar(1) <> Page(VSIndexTab.MouseOver).Tag Then StatusBar(1) = Page(VSIndexTab.MouseOver).Tag
-
- End If
-
- End Sub
-
- ***************** D:\VB_APPS\ELASTIC\MENU.FRM *****************
- Sub Command1_Click (Index As Integer)
- mousepointer = 11
- Select Case Index
- Case 0
- Splitter.Show 1
- Case 1
- fFlood.Show 1
- Case 2
- IndexTab.Show 1
- Case 3
- calculator.Show 1
- Case 4
- fProp.Show 1
- Case 5
- fnolabels.Show 1
- Case 6
- fMultiTabs.Show 1
- Case 7
- fbuttons.Show 1
-
- End Select
- mousepointer = 0
- End Sub
-
- Sub Form_Load ()
- 'Resolution independence
- 'Place form on lower part of the screen
- Me.Move 0, screen.Height * .25
- Me.Width = screen.Width
- Me.Height = screen.Height * .75
- 'Check Version
- On Error Resume Next
- If VSElastic1(0).Version < 4 Then MsgBox "An older version of VideoSoft VSVBX is loaded in your system. This demo may not work properly."
- End Sub
-
- Sub Form_Resize ()
- 'no code
- End Sub
-
-