home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{9973B72E-F1FF-4E96-AA76-225706910672}#4.8#0"; "FlatStrip5.ocx"
- Begin VB.Form frmFlatTabsCollection
- BorderStyle = 3 'Fixed Dialog
- Caption = "FlatTabs Collection Demonstration"
- ClientHeight = 4920
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 7320
- BeginProperty Font
- Name = "Tahoma"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Icon = "FlatTabsCollection.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 328
- ScaleMode = 3 'Pixel
- ScaleWidth = 488
- ShowInTaskbar = 0 'False
- StartUpPosition = 2 'CenterScreen
- Begin VB.CommandButton cmdAction
- Caption = "&MoveTo"
- Height = 330
- Index = 10
- Left = 2655
- TabIndex = 10
- Tag = "The MoveTo method moves the source item to the positon after the destination item"
- Top = 2835
- Width = 1140
- End
- Begin FlatStripDemonstration.pucTextTip tipHelp
- Height = 1545
- Left = 5130
- TabIndex = 13
- Top = 2025
- Width = 1995
- _ExtentX = 3519
- _ExtentY = 2725
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Tahoma"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Begin VB.CommandButton cmdAction
- Caption = "&KeyToIndex"
- Height = 330
- Index = 9
- Left = 1440
- TabIndex = 7
- Tag = "The KeyToIndex function will return the Index of a FlatTab identified by Index or Key"
- Top = 3240
- Width = 1140
- End
- Begin VB.CommandButton cmdAction
- Caption = "&Parent"
- Height = 330
- Index = 8
- Left = 3870
- TabIndex = 11
- Tag = "The Parent property returns a reference to the parent FlatStrip control this collection belongs to, or Nothing if not attached."
- Top = 2025
- Width = 1140
- End
- Begin VB.CommandButton cmdAction
- Caption = "Cl&ear"
- Height = 330
- Index = 7
- Left = 225
- TabIndex = 3
- Tag = "The Clear method removes all FlatTab objects"
- Top = 2835
- Width = 1140
- End
- Begin VB.CommandButton cmdAction
- Caption = "&SwapItem"
- Height = 330
- Index = 6
- Left = 2655
- TabIndex = 9
- Tag = "The Swap method swaps the contents of two FlatTab objects with each other"
- Top = 2430
- Width = 1140
- End
- Begin VB.CommandButton cmdAction
- Caption = "Cl&oneItem"
- Height = 330
- Index = 5
- Left = 2655
- TabIndex = 8
- Tag = "The CloneItem method copies the contents of of FlatTab object into another"
- Top = 2025
- Width = 1140
- End
- Begin VB.CommandButton cmdAction
- Caption = "&Count"
- Height = 330
- Index = 4
- Left = 1440
- TabIndex = 4
- Tag = "The Count property returns the total number of FlatTabs in the collection"
- Top = 2025
- Width = 1140
- End
- Begin VB.CommandButton cmdAction
- Caption = "E&numeration"
- Height = 330
- Index = 3
- Left = 1440
- TabIndex = 6
- Tag = "This is not actually a property, but rather a feature - you can enumerate through all items in the collection."
- Top = 2835
- Width = 1140
- End
- Begin VB.CommandButton cmdAction
- Caption = "&Item"
- Height = 330
- Index = 2
- Left = 1440
- TabIndex = 5
- Tag = "The Item property returns a reference to a single FlatTab object"
- Top = 2430
- Width = 1140
- End
- Begin VB.CommandButton cmdAction
- Caption = "&Remove"
- Height = 330
- Index = 1
- Left = 225
- TabIndex = 2
- Tag = "The Remove method removes an existing FlatTab object"
- Top = 2430
- Width = 1140
- End
- Begin VB.CommandButton cmdAction
- Caption = "&Add"
- Height = 330
- Index = 0
- Left = 225
- TabIndex = 1
- Tag = "The Add function adds a new FlatTab to the collection and returns it."
- Top = 2025
- Width = 1140
- End
- Begin VB.CommandButton cmdClose
- Cancel = -1 'True
- Caption = "C&lose"
- Default = -1 'True
- Height = 330
- Left = 5985
- TabIndex = 12
- Top = 3735
- Width = 1140
- End
- Begin FlatStripCtl.FlatStrip ftsDemo
- Height = 420
- Left = 180
- Top = 4275
- Width = 6945
- _ExtentX = 12250
- _ExtentY = 741
- ShowClientArea = 0 'False
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Tahoma"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Begin FlatStripDemonstration.pucTextTip pucTextTip1
- Height = 960
- Left = 180
- TabIndex = 0
- Top = 900
- Width = 6945
- _ExtentX = 12250
- _ExtentY = 1693
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Tahoma"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Text = $"FlatTabsCollection.frx":014A
- End
- Begin FlatStripDemonstration.pucLogoPane pucLogoPane1
- Align = 1 'Align Top
- Height = 750
- Left = 0
- Top = 0
- Width = 7320
- _ExtentX = 12912
- _ExtentY = 1323
- Picture = "FlatTabsCollection.frx":026F
- End
- Attribute VB_Name = "frmFlatTabsCollection"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub cmdAction_Click(Index As Integer)
- Dim FlatTab As FlatStripCtl.FlatTab
- Dim Browse As frmSelectItems
- Dim Return1 As String
- Dim Return2 As String
- Select Case Index
- Case 0
- 'add
- Return1 = InputBox("Enter the Text of your new FlatTab:", "Add")
- If Len(Return1) Then
- ftsDemo.FlatTabs.Add , "!" & (Int(Rnd * 10000) + Int(Rnd * 10000)), Return1
- End If
- Case 1
- 'remove
- Set Browse = New frmSelectItems
- If Browse.SelectItem(ftsDemo, "Remove Item", "Item to &remove:", "", Return1, Return2) Then
- ftsDemo.FlatTabs.Remove Return1
- End If
- Case 2
- 'item
- Set Browse = New frmSelectItems
- If Browse.SelectItem(ftsDemo, "Query Item", "Item to &query:", "", Return1, Return2) Then
- With ftsDemo.FlatTabs(Return1)
- MsgBox "The Index of the FlatTab you selected is " & .Index & " and it's dimensions are:" & vbCr & vbCr & _
- "Left: " & .Left & vbCr & _
- "Top: " & .Top & vbCr & _
- "Width: " & .Width & vbCr & _
- "Height: " & .Height & vbCr & vbCr & _
- IIf(.Selected, "Tab is selected", "Tab is not selected") _
- , vbInformation
- End With
- End If
- Case 3
- 'newenum
- For Each FlatTab In ftsDemo.FlatTabs
- Return1 = Return1 & FlatTab.Key & vbCr
- Next
- MsgBox "The Keys of all the FlatTabs in the collection are:" & vbCr & vbCr & Return1, vbInformation
- Case 4
- 'count
- MsgBox "There are " & ftsDemo.FlatTabs.Count & " FlatTab objects in the FlatTabs collection.", vbInformation
- Case 5
- 'cloneitem
- Set Browse = New frmSelectItems
- If Browse.SelectItem(ftsDemo, "Clone", "&Source FlatTab:", "&Destination FlatTab:", Return1, Return2) Then
- With ftsDemo.FlatTabs
- .CloneItem .Item(Return1), .Item(Return2)
- End With
- MsgBox "FlatTab '" & Return1 & "' has been cloned into FlatTab '" & Return2 & "'.", vbInformation
- End If
- Case 6
- 'swap
- Set Browse = New frmSelectItems
- If Browse.SelectItem(ftsDemo, "Swap", "&Source FlatTab:", "&Destination FlatTab:", Return1, Return2) Then
- With ftsDemo.FlatTabs
- .SwapItem .Item(Return1), .Item(Return2)
- End With
- MsgBox "FlatTab '" & Return1 & "' has been swapped with FlatTab '" & Return2 & "'.", vbInformation
- End If
- Case 7
- 'clear
- If MsgBox("Are you sure you want to clear all items from the collection?", vbYesNo Or vbQuestion) = vbYes Then
- ftsDemo.FlatTabs.Clear
- End If
- Case 8
- 'parent
- MsgBox "The handle of the parent FlatStrip control is '" & ftsDemo.FlatTabs.Parent.hWnd & "'", vbInformation
- Case 9
- 'keytoindex
- Set Browse = New frmSelectItems
- If Browse.SelectItem(ftsDemo, "KeyToIndex", "Item to &query:", "", Return1, Return2) Then
- MsgBox "The return of KeyToIndex on your selected key of '" & Return1 & "' is " & ftsDemo.FlatTabs.KeyToIndex(Return1) & ".", vbInformation
- End If
- Case 10
- 'moveto
- Set Browse = New frmSelectItems
- If Browse.SelectItem(ftsDemo, "MoveTo", "&Source FlatTab:", "&Destination FlatTab:", Return1, Return2) Then
- With ftsDemo.FlatTabs
- .MoveTo .Item(Return1), .Item(Return2)
- End With
- MsgBox "FlatTab '" & Return1 & "' has been moved to the slot after FlatTab '" & Return2 & "'.", vbInformation
- End If
- End Select
- End Sub
- Private Sub cmdAction_GotFocus(Index As Integer)
- 'update the help FlatTab
- tipHelp.Text = cmdAction(Index).Tag
- End Sub
- Private Sub cmdClose_Click()
- Unload Me
- End Sub
- Private Sub Form_Load()
- Dim IndexLoop As Integer
- For IndexLoop = 1 To 5
- ftsDemo.FlatTabs.Add , "FlatTab" & IndexLoop, "FlatTab #" & IndexLoop
- Next
- End Sub
-