home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{13E51000-A52B-11D0-86DA-00608CB9FBFB}#5.0#0"; "VCF15.OCX"
- Begin VB.Form Form1
- Caption = "Objects"
- ClientHeight = 9045
- ClientLeft = 165
- ClientTop = 450
- ClientWidth = 9555
- LinkTopic = "Form1"
- ScaleHeight = 9045
- ScaleWidth = 9555
- StartUpPosition = 2 'CenterScreen
- Begin VB.Frame Button
- Caption = "Button"
- Height = 720
- Left = 5880
- TabIndex = 58
- Top = 4980
- Width = 1785
- Begin VB.CommandButton btnbtnObjText
- Caption = "ObjText"
- Height = 300
- Left = 195
- TabIndex = 59
- Top = 285
- Width = 1380
- End
- End
- Begin VB.Frame Frame6
- Caption = "Picture"
- Height = 2190
- Left = 7740
- TabIndex = 32
- Top = 4965
- Width = 1800
- Begin VB.PictureBox Picture2
- Height = 630
- Left = 1005
- Picture = "Objects.frx":0000
- ScaleHeight = 570
- ScaleWidth = 615
- TabIndex = 62
- Top = 1380
- Width = 675
- End
- Begin VB.PictureBox Picture1
- Height = 630
- Left = 210
- Picture = "Objects.frx":08C4
- ScaleHeight = 570
- ScaleWidth = 615
- TabIndex = 61
- Top = 1410
- Width = 675
- End
- Begin VB.CommandButton btnObjCreatePicture
- Caption = "ObjCreatePicture"
- Height = 300
- Left = 90
- TabIndex = 35
- Top = 255
- Width = 1620
- End
- Begin VB.CommandButton btnObjNewPicture
- Caption = "ObjNewPicture"
- Height = 300
- Left = 90
- TabIndex = 34
- Top = 600
- Width = 1620
- End
- Begin VB.CommandButton btnObjSetPicture
- Caption = "ObjSetPicture"
- Height = 330
- Left = 90
- TabIndex = 33
- Top = 945
- Width = 1620
- End
- End
- Begin VB.Frame Frame5
- Caption = "Polygon"
- Height = 1395
- Left = 5880
- TabIndex = 26
- Top = 5760
- Width = 1800
- Begin VB.CommandButton btnObjSetPolygonPoints
- Caption = "ObjSetPolygonPoints"
- Height = 330
- Left = 90
- TabIndex = 29
- Top = 945
- Width = 1620
- End
- Begin VB.CommandButton btnObjNewPolygon
- Caption = "ObjNewPolygon"
- Height = 300
- Left = 90
- TabIndex = 28
- Top = 600
- Width = 1620
- End
- Begin VB.CommandButton btnObjCreatePolygon
- Caption = "ObjCreatePolygon"
- Height = 300
- Left = 90
- TabIndex = 27
- Top = 255
- Width = 1620
- End
- End
- Begin VB.Frame Frame4
- Caption = "Objects"
- Height = 4575
- Left = 45
- TabIndex = 23
- Top = 4365
- Width = 4020
- Begin VB.CommandButton btnObjVisible
- Caption = "ObjVisible"
- Height = 300
- Left = 2460
- TabIndex = 66
- Top = 4200
- Width = 1470
- End
- Begin VB.CommandButton btnObjPatternStyle
- Caption = "ObjPatternStyle"
- Height = 300
- Left = 90
- TabIndex = 65
- Top = 4200
- Width = 1740
- End
- Begin VB.CommandButton btnObjPatternFG
- Caption = "ObjPatternFG"
- Height = 300
- Left = 90
- TabIndex = 64
- Top = 3855
- Width = 1740
- End
- Begin VB.CommandButton btnObjPatternBG
- Caption = "ObjPatternBG"
- Height = 300
- Left = 90
- TabIndex = 63
- Top = 3525
- Width = 1740
- End
- Begin VB.CommandButton btnObjGetPosEx
- Caption = "ObjGetPosEx"
- Height = 300
- Left = 2460
- TabIndex = 53
- Top = 945
- Width = 1470
- End
- Begin VB.CommandButton btnObjNameToID
- Caption = "ObjNameToID"
- Height = 300
- Left = 90
- TabIndex = 52
- Top = 2430
- Width = 1215
- End
- Begin VB.CommandButton btnObjFirstID
- Caption = "ObjFirstID"
- Height = 300
- Left = 90
- TabIndex = 51
- Top = 2775
- Width = 1215
- End
- Begin VB.CommandButton btnObjNextID
- Caption = "ObjNextID"
- Height = 300
- Left = 90
- TabIndex = 50
- Top = 3120
- Width = 1215
- End
- Begin VB.CommandButton btnObjBringToFront
- Caption = "ObjBringToFront"
- Height = 300
- Left = 2460
- TabIndex = 49
- Top = 3180
- Width = 1470
- End
- Begin VB.CommandButton btnObjSendToBack
- Caption = "ObjSendToBack"
- Height = 300
- Left = 2460
- TabIndex = 48
- Top = 3525
- Width = 1470
- End
- Begin VB.CommandButton btnObjOptionsDlg
- Caption = "ObjOptionsDlg"
- Height = 300
- Left = 2460
- TabIndex = 47
- Top = 2760
- Width = 1470
- End
- Begin VB.CommandButton btnObjNameDlg
- Caption = "ObjNameDlg"
- Height = 300
- Left = 2460
- TabIndex = 46
- Top = 2415
- Width = 1470
- End
- Begin VB.CommandButton btnObjGetSelection
- Caption = "ObjGetSelection"
- Height = 300
- Left = 90
- TabIndex = 45
- Top = 1005
- Width = 1740
- End
- Begin VB.CommandButton btnObjSetSelection
- Caption = "ObjSetSelection"
- Height = 300
- Left = 90
- TabIndex = 44
- Top = 1335
- Width = 1740
- End
- Begin VB.CommandButton btnObjAddSelection
- Caption = "ObjAddSelection"
- Height = 300
- Left = 90
- TabIndex = 43
- Top = 1680
- Width = 1740
- End
- Begin VB.CommandButton btnObjGetSelectionCount
- Caption = "ObjGetSelectionCount"
- Height = 300
- Left = 90
- TabIndex = 42
- Top = 2025
- Width = 1740
- End
- Begin VB.CommandButton btnObjGetType
- Caption = "ObjGetType"
- Height = 300
- Left = 1260
- TabIndex = 41
- Top = 270
- Width = 1050
- End
- Begin VB.CommandButton btnObjPosToTwipsEx
- Caption = "ObjPosToTwipsEx"
- Height = 300
- Left = 2460
- TabIndex = 40
- Top = 1995
- Width = 1470
- End
- Begin VB.CommandButton btnObjPosToTwips
- Caption = "ObjPosToTwips"
- Height = 300
- Left = 2460
- TabIndex = 39
- Top = 1650
- Width = 1470
- End
- Begin VB.CommandButton btnObjPosShown
- Caption = "ObjPosShown"
- Height = 300
- Left = 2460
- TabIndex = 38
- Top = 1305
- Width = 1470
- End
- Begin VB.CommandButton btnObjGetPos
- Caption = "ObjGetPos"
- Height = 300
- Left = 2460
- TabIndex = 37
- Top = 600
- Width = 1470
- End
- Begin VB.CommandButton btnObjSetPos
- Caption = "ObjSetPos"
- Height = 300
- Left = 2460
- TabIndex = 36
- Top = 255
- Width = 1470
- End
- Begin VB.CommandButton btnObjNew
- Caption = "ObjNew"
- Height = 300
- Left = 90
- TabIndex = 25
- Top = 615
- Width = 1050
- End
- Begin VB.CommandButton btnObjCreate
- Caption = "ObjCreate"
- Height = 300
- Left = 90
- TabIndex = 24
- Top = 270
- Width = 1050
- End
- End
- Begin VB.Frame Frame3
- Caption = "CheckBox"
- Height = 2145
- Left = 4245
- TabIndex = 20
- Top = 4995
- Width = 1575
- Begin VB.CommandButton btnObjText
- Caption = "ObjText"
- Height = 300
- Left = 90
- TabIndex = 57
- Top = 1410
- Width = 1380
- End
- Begin VB.CommandButton btnObjValue
- Caption = "ObjValue"
- Height = 300
- Left = 90
- TabIndex = 56
- Top = 1785
- Width = 1380
- End
- Begin VB.CommandButton btnchkObjCellType
- Caption = "ObjCellType"
- Height = 300
- Left = 90
- TabIndex = 31
- Top = 990
- Width = 1380
- End
- Begin VB.CommandButton btnchkObjGetCell
- Caption = "ObjGetCell"
- Height = 300
- Left = 90
- TabIndex = 22
- Top = 630
- Width = 1380
- End
- Begin VB.CommandButton btnchkObjSetCell
- Caption = "ObjSetCell"
- Height = 300
- Left = 90
- TabIndex = 21
- Top = 285
- Width = 1380
- End
- End
- Begin VB.Frame Frame2
- Caption = "ComboBox"
- Height = 1695
- Left = 4230
- TabIndex = 11
- Top = 7260
- Width = 4605
- Begin VB.CommandButton Command1
- Caption = "ObjValue"
- Height = 300
- Left = 1575
- TabIndex = 60
- Top = 630
- Width = 1380
- End
- Begin VB.CommandButton btnObjItems
- Caption = "ObjItems"
- Height = 300
- Left = 1575
- TabIndex = 55
- Top = 1320
- Width = 1380
- End
- Begin VB.CommandButton btnObjItem
- Caption = "ObjItem"
- Height = 300
- Left = 1575
- TabIndex = 54
- Top = 975
- Width = 1380
- End
- Begin VB.CommandButton btnObjCellTyp
- Caption = "ObjCellType"
- Height = 300
- Left = 1575
- TabIndex = 30
- Top = 285
- Width = 1380
- End
- Begin VB.CommandButton btnObjCellCol
- Caption = "ObjCellCol"
- Height = 300
- Left = 3060
- TabIndex = 19
- Top = 1320
- Width = 1380
- End
- Begin VB.CommandButton btnObjCellRow
- Caption = "ObjCellRow"
- Height = 300
- Left = 3060
- TabIndex = 18
- Top = 975
- Width = 1380
- End
- Begin VB.CommandButton btnObjSetCell
- Caption = "ObjSetCell"
- Height = 300
- Left = 3060
- TabIndex = 17
- Top = 285
- Width = 1380
- End
- Begin VB.CommandButton btnObjGetCell
- Caption = "ObjGetCell"
- Height = 300
- Left = 3060
- TabIndex = 16
- Top = 630
- Width = 1380
- End
- Begin VB.CommandButton btnObjGetItemCount
- Caption = "ObjGetItemCount"
- Height = 300
- Left = 90
- TabIndex = 15
- Top = 1320
- Width = 1380
- End
- Begin VB.CommandButton btnObjAddItem
- Caption = "ObjAddItem"
- Height = 300
- Left = 90
- TabIndex = 14
- Top = 285
- Width = 1380
- End
- Begin VB.CommandButton btnObjDeleteItem
- Caption = "ObjDeleteItem"
- Height = 300
- Left = 90
- TabIndex = 13
- Top = 630
- Width = 1380
- End
- Begin VB.CommandButton btnObjInsertItem
- Caption = "ObjInsertItem"
- Height = 300
- Left = 90
- TabIndex = 12
- Top = 975
- Width = 1380
- End
- End
- Begin VB.Frame Frame1
- Height = 600
- Left = 0
- TabIndex = 1
- Top = -60
- Width = 9540
- Begin VB.CommandButton btnChart
- Height = 375
- Left = 3585
- Picture = "Objects.frx":39A6
- Style = 1 'Graphical
- TabIndex = 10
- Top = 165
- Width = 435
- End
- Begin VB.CommandButton btnCombobox
- Height = 375
- Left = 3165
- Picture = "Objects.frx":4048
- Style = 1 'Graphical
- TabIndex = 9
- Top = 165
- Width = 435
- End
- Begin VB.CommandButton btnCheckbox
- Height = 375
- Left = 2745
- Picture = "Objects.frx":46EA
- Style = 1 'Graphical
- TabIndex = 8
- Top = 165
- Width = 435
- End
- Begin VB.CommandButton btnButton
- Height = 375
- Left = 2325
- Picture = "Objects.frx":4D8C
- Style = 1 'Graphical
- TabIndex = 7
- Top = 165
- Width = 435
- End
- Begin VB.CommandButton btnPolygon
- Height = 375
- Left = 1800
- Picture = "Objects.frx":542E
- Style = 1 'Graphical
- TabIndex = 6
- Top = 165
- Width = 435
- End
- Begin VB.CommandButton btnArc
- Height = 375
- Left = 1380
- Picture = "Objects.frx":5AD0
- Style = 1 'Graphical
- TabIndex = 5
- Top = 165
- Width = 435
- End
- Begin VB.CommandButton btnOval
- Height = 375
- Left = 960
- Picture = "Objects.frx":6172
- Style = 1 'Graphical
- TabIndex = 4
- Top = 165
- Width = 435
- End
- Begin VB.CommandButton btnRectangle
- Height = 375
- Left = 540
- Picture = "Objects.frx":6814
- Style = 1 'Graphical
- TabIndex = 3
- Top = 165
- Width = 435
- End
- Begin VB.CommandButton btnLine
- Height = 375
- Left = 120
- Picture = "Objects.frx":6EB6
- Style = 1 'Graphical
- TabIndex = 2
- Top = 165
- Width = 435
- End
- End
- Begin VCF150Ctl.F1Book F1Book1
- Height = 3660
- Left = 15
- TabIndex = 0
- Top = 585
- Width = 9525
- _ExtentX = 16801
- _ExtentY = 6456
- _0 = $"Objects.frx":7558
- _1 = $"Objects.frx":795D
- _2 = $"Objects.frx":7D62
- _3 = $"Objects.frx":8167
- _4 = $"Objects.frx":856C
- _count = 5
- _ver = 1
- End
- Begin VB.Menu mnuObjects
- Caption = "&Objects"
- Begin VB.Menu mnuOptions
- Caption = "&Options..."
- End
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub btnArc_Click()
- F1Book1.Mode = F1ModeArc
- End Sub
- Private Sub btnbtnObjText_Click()
- Dim ObjID As Long
- On Error GoTo ObjNotFoundErr
- ObjID = F1Book1.ObjSelection(0)
- F1Book1.ObjText(ObjID) = InputBox("Change the text from " & F1Book1.ObjText(ObjID) & " to:")
- Exit Sub
- ObjNotFoundErr:
- MsgBox "A Checkbox or button object must be selected."
- End Sub
- Private Sub btnButton_Click()
- F1Book1.Mode = F1ModeButton
- End Sub
- Private Sub btnChart_Click()
- F1Book1.Mode = F1ModeChart
- End Sub
- Private Sub btnCheckbox_Click()
- F1Book1.Mode = F1ModeCheckBox
- End Sub
- Private Sub btnchkObjCellType_Click()
- Dim ObjID As Long
- On Error GoTo ObjNotFoundErr
-
- F1Book1.ObjGetSelection 0, ObjID
- If F1Book1.ObjGetType(ObjID) = F1ObjCheckBox Then
- If F1Book1.ObjCellType(ObjID) = F1ControlCellText Then
- MsgBox "Combo text appears in the cell."
- ElseIf F1Book1.ObjCellType(ObjID) = F1ControlCellValue Then
- MsgBox "Combo value appears in the cell."
- ElseIf F1Book1.ObjCellType(ObjID) = F1ControlNoCell Then
- MsgBox "Neither text nor value is diplayed."
- End If
- Else
- GoTo ObjNotFoundErr
- End If
- Exit Sub
- ObjNotFoundErr:
- MsgBox "A CheckBox object is not selected."
- End Sub
- Private Sub btnchkObjGetCell_Click()
- Dim ObjID As Long
- Dim pHasCell As Integer
- Dim pRow As Long
- Dim pCol As Long
- On Error GoTo ObjNotFoundErr
- F1Book1.ObjGetSelection 0, ObjID
- If F1Book1.ObjGetType(ObjID) = F1ObjCheckBox Then
- F1Book1.ObjGetCell ObjID, pHasCell, pRow, pCol
- MsgBox "CheckBox results appear in row " & pRow & " and column " & pCol
- Else
- GoTo ObjNotFoundErr
- End If
- Exit Sub
- ObjNotFoundErr:
- MsgBox "A CheckBox object is not selected."
- End Sub
- Private Sub btnchkObjSetCell_Click()
- Dim ObjID As Long
- Dim CellType As Integer
- Dim nRow As Long
- Dim nCol As Long
- On Error GoTo ObjNotFoundErr
- F1Book1.ObjGetSelection 0, ObjID
- If F1Book1.ObjGetType(ObjID) = F1ObjCheckBox Then
- CellType = 2
- nRow = InputBox("Enter the Row:")
- nCol = InputBox("Enter the Column:")
- F1Book1.ObjSetCell ObjID, CellType, nRow, nCol
- Else
- GoTo ObjNotFoundErr
- End If
- Exit Sub
- ObjNotFoundErr:
- MsgBox "A CheckBox object is not selected."
- End Sub
- Private Sub btnCombobox_Click()
- F1Book1.Mode = F1ModeDropDown
- End Sub
- Private Sub btnLine_Click()
- F1Book1.Mode = F1ModeLine
- End Sub
- Private Sub btnObjAddItem_Click()
- Dim ObjID As Long
- Dim ItemText As String
- On Error GoTo ObjNotFoundErr
- F1Book1.ObjGetSelection 0, ObjID
- If F1Book1.ObjGetType(ObjID) = F1ObjDropDown Then
- ItemText = InputBox("Enter Item to Add:")
- F1Book1.ObjAddItem ObjID, ItemText
- Else
- GoTo ObjNotFoundErr
- End If
- Exit Sub
- ObjNotFoundErr:
- MsgBox "A ComboBox object is not selected."
- End Sub
- Private Sub btnObjAddSelection_Click()
- Dim ObjID As Long
- On Error GoTo ObjNotFoundErr
- ObjID = InputBox("Enter the ObjID of the object you wish to add to the selection.")
- F1Book1.ObjAddSelection ObjID
- Exit Sub
- ObjNotFoundErr:
- MsgBox "That object was not found."
- End Sub
- Private Sub btnObjBringToFront_Click()
- On Error GoTo ObjNotFoundErr
-
- F1Book1.ObjBringToFront
- Exit Sub
- ObjNotFoundErr:
- MsgBox "An object must be selected."
- End Sub
- Private Sub btnObjCellCol_Click()
- Dim ObjID As Long
- On Error GoTo ObjNotFoundErr
-
- F1Book1.ObjGetSelection 0, ObjID
- If F1Book1.ObjGetType(ObjID) = F1ObjDropDown Then
- MsgBox "Combo results appears in column " & F1Book1.ObjCellCol(ObjID)
- Else
- GoTo ObjNotFoundErr
- End If
- Exit Sub
- ObjNotFoundErr:
- MsgBox "A ComboBox object is not selected."
- End Sub
- Private Sub btnObjCellRow_Click()
- Dim ObjID As Long
- On Error GoTo ObjNotFoundErr
-
- F1Book1.ObjGetSelection 0, ObjID
- If F1Book1.ObjGetType(ObjID) = F1ObjDropDown Then
- MsgBox "Combo results appears in row " & F1Book1.ObjCellRow(ObjID)
- Else
- GoTo ObjNotFoundErr
- End If
- Exit Sub
- ObjNotFoundErr:
- MsgBox "A ComboBox object is not selected."
- End Sub
- Private Sub btnObjCellTyp_Click()
- Dim ObjID As Long
- On Error GoTo ObjNotFoundErr
-
- F1Book1.ObjGetSelection 0, ObjID
- If F1Book1.ObjGetType(ObjID) = F1ObjDropDown Then
- If F1Book1.ObjCellType(ObjID) = F1ControlCellText Then
- MsgBox "Combo text appears in the cell."
- ElseIf F1Book1.ObjCellType(ObjID) = F1ControlCellValue Then
- MsgBox "Combo value appears in the cell."
- ElseIf F1Book1.ObjCellType(ObjID) = F1ControlNoCell Then
- MsgBox "Neither text nor value is diplayed."
- End If
- Else
- GoTo ObjNotFoundErr
- End If
- Exit Sub
- ObjNotFoundErr:
- MsgBox "A ComboBox object is not selected."
- End Sub
- Private Sub btnObjCreate_Click()
- Dim ObjID As Long
- Form3.Show 1
- Select Case F1Book1.Tag
- Case "Line"
- ObjType = F1ObjLine
- Case "Rectangle"
- ObjType = F1ObjRectangle
- Case "Oval"
- ObjType = F1ObjOval
- Case "Arc"
- ObjType = F1ObjArc
- Case "Button"
- ObjType = F1ObjButton
- Case "CheckBox"
- ObjType = F1ObjCheckBox
- Case "ComboBox"
- ObjType = F1ObjDropDown
- Case "Chart"
- ObjType = F1ObjChart
- Case "Cancel"
- Exit Sub
- End Select
- nX1 = 1
- nY1 = 1
- nX2 = 3
- nY2 = 3
- ObjID = F1Book1.ObjCreate(ObjType, nX1, nY1, nX2, nY2)
- End Sub
- Private Sub btnObjCreatePicture_Click()
- Dim ObjID As Long
- Dim nX1 As Single
- Dim nY1 As Single
- Dim nX2 As Single
- Dim nY2 As Single
- Dim hMF As OLE_HANDLE
- Dim nMapMode As Long
- Dim nWndExtentX As Long
- Dim nWndExtentY As Long
- Dim MapMode As Integer
- nX1 = 1
- nY1 = 7
- nX2 = 4
- nY2 = 12
- MapMode = MsgBox("Do you wish to strecth the image to fit?", vbYesNo)
- If MapMode = vbYes Then
- nMapMode = 8
- Else
- nMapMode = 7
- End If
- hMF = Picture1.Picture
- nWndExtentX = Picture1.ScaleWidth
- nWndExtentY = Picture1.ScaleHeight
- ObjID = F1Book1.ObjCreatePicture(nX1, nY1, nX2, nY2, hMF, nMapMode, nWndExtentX, nWndExtentY)
- End Sub
- Private Sub btnObjCreatePolygon_Click()
- Dim ObjID As Long
- Dim X1 As Single
- Dim Y1 As Single
- Dim X2 As Single
- Dim Y2 As Single
- Dim ArrayX(5) As Variant
- Dim ArrayY(5) As Variant
- Dim pClosed As Boolean
- X1 = 1
- Y1 = 1
- X2 = 5
- Y2 = 5
- ArrayX(1) = 1
- ArrayX(2) = 8000
- ArrayX(3) = 15000
- ArrayX(4) = 16000
- ArrayX(5) = 4000
- ArrayY(1) = 1
- ArrayY(2) = 10000
- ArrayY(3) = 13000
- ArrayY(4) = 11000
- ArrayY(5) = 800
- pClosed = True
- ObjID = F1Book1.ObjCreatePolygon(X1, Y1, X2, Y2, ArrayX, ArrayY, pClosed)
- End Sub
- Private Sub btnObjDeleteItem_Click()
- Dim ObjID As Long
- On Error GoTo ObjNotFoundErr
- If F1Book1.ObjGetItemCount(F1Book1.ObjSelection(0)) = 0 Then
- MsgBox "No Items to Delete."
- Exit Sub
- End If
- F1Book1.ObjGetSelection 0, ObjID
- If F1Book1.ObjGetType(ObjID) = F1ObjDropDown Then
- Form2.Show 1
- If F1Book1.Tag = "Cancel" Or F1Book1.Tag = -1 Then
- Exit Sub
- Else
- F1Book1.ObjDeleteItem ObjID, F1Book1.Tag
- End If
- Else
- GoTo ObjNotFoundErr
- End If
- Exit Sub
- ObjNotFoundErr:
- MsgBox "A ComboBox object is not selected."
- End Sub
- Private Sub btnObjFirstID_Click()
- On Error GoTo ObjNotFoundErr
- MsgBox "The ID of the first object is " & F1Book1.ObjFirstID
- Exit Sub
- ObjNotFoundErr:
- MsgBox "No objects available."
- End Sub
- Private Sub btnObjGetCell_Click()
- Dim ObjID As Long
- Dim pHasCell As Integer
- Dim pRow As Long
- Dim pCol As Long
- On Error GoTo ObjNotFoundErr
- F1Book1.ObjGetSelection 0, ObjID
- If F1Book1.ObjGetType(ObjID) = F1ObjDropDown Then
- F1Book1.ObjGetCell ObjID, pHasCell, pRow, pCol
- MsgBox "Combo results appear in row " & pRow & " and column " & pCol
- Else
- GoTo ObjNotFoundErr
- End If
- Exit Sub
- ObjNotFoundErr:
- MsgBox "A ComboBox object is not selected."
- End Sub
- Private Sub btnObjGetItemCount_Click()
- Dim ObjID As Long
- On Error GoTo ObjNotFoundErr
- F1Book1.ObjGetSelection 0, ObjID
- If F1Book1.ObjGetType(ObjID) = F1ObjDropDown Then
- MsgBox "Combo has " & Str(F1Book1.ObjGetItemCount(ObjID)) & " items."
- Else
- GoTo ObjNotFoundErr
- End If
- Exit Sub
- ObjNotFoundErr:
- MsgBox "A ComboBox object is not selected."
- End Sub
- Private Sub btnObjGetPos_Click()
- Dim ObjID As Long
- Dim pX1 As Single
- Dim pY1 As Single
- Dim pX2 As Single
- Dim pY2 As Single
- On Error GoTo ObjNotFoundErr
- ObjID = F1Book1.ObjSelection(0)
-
- F1Book1.ObjGetPos ObjID, pX1, pY1, pX2, pY2
- MsgBox "Objects top row is: " & pY1
- MsgBox "Objects left column is: " & pX1
- MsgBox "Objects bottom row is: " & pY2
- MsgBox "Objects right column is: " & pX2
- Exit Sub
- ObjNotFoundErr:
- MsgBox "An object must be selected first."
- End Sub
- Private Sub btnObjGetPosEx_Click()
- Dim ObjID As Long
- Dim F1Pos As F1ObjPos
- On Error GoTo ObjNotFoundErr
- ObjID = F1Book1.ObjSelection(0)
-
- Set F1Pos = F1Book1.ObjGetPosEx(ObjID)
- MsgBox "Objects top row is: " & F1Pos.StartRow
- MsgBox "Objects left column is: " & F1Pos.StartCol
- MsgBox "Objects bottom row is: " & F1Pos.EndRow
- MsgBox "Objects right column is: " & F1Pos.EndCol
- Exit Sub
- ObjNotFoundErr:
- MsgBox "An object must be selected first."
- End Sub
- Private Sub btnObjGetSelection_Click()
- Dim nSelection As Integer
- Dim pID As Long
- Dim x As Integer
- On Error GoTo ObjNotFoundErr
- For x = 0 To F1Book1.ObjGetSelectionCount - 1
- nSelection = x
- F1Book1.ObjGetSelection nSelection, pID
- MsgBox "Object selection index " & nSelection & " is ObjID " & pID
- Next x
- Exit Sub
- ObjNotFoundErr:
- MsgBox "Not objects were selected."
- End Sub
- Private Sub btnObjGetSelectionCount_Click()
- Dim nSelection As Integer
- Dim pID As Long
- Dim x As Integer
- On Error GoTo ObjNotFoundErr
- nSelection = F1Book1.ObjGetSelectionCount
- MsgBox nSelection & " items selected."
- Exit Sub
- ObjNotFoundErr:
- MsgBox "Not objects were selected."
- End Sub
- Private Sub btnObjGetType_Click()
- Dim ObjID As Long
- Dim ObjType As F1ObjTypeConstants
- On Error GoTo ObjNotFoundErr
- ObjID = F1Book1.ObjSelection(0)
- ObjType = F1Book1.ObjGetType(ObjID)
- Select Case ObjType
- Case F1ObjLine
- MsgBox "This is a line object."
- Case F1ObjRectangle
- MsgBox "This is a rectangle object."
- Case F1ObjOval
- MsgBox "This is an oval object."
- Case F1ObjArc
- MsgBox "This is an arc object."
- Case F1ObjButton
- MsgBox "This is a button object."
- Case F1ObjCheckBox
- MsgBox "This is a checkbox object."
- Case F1ObjDropDown
- MsgBox "This is a combobox object."
- Case F1ObjChart
- MsgBox "This is a chart object."
- Case F1ObjPicture
- MsgBox "This is a picture object."
- Case F1ObjPolygon
- MsgBox "This is a polygon object."
- End Select
- Exit Sub
- ObjNotFoundErr:
- MsgBox "An object must be selected."
- End Sub
- Private Sub btnObjInsertItem_Click()
- Dim ObjID As Long
- Dim ItemText As String
- On Error GoTo ObjNotFoundErr
- F1Book1.ObjGetSelection 0, ObjID
- If F1Book1.ObjGetType(ObjID) = F1ObjDropDown Then
- ItemText = InputBox("Enter Item to Add:")
- F1Book1.ObjInsertItem ObjID, 0, ItemText
- Else
- GoTo ObjNotFoundErr
- End If
- Exit Sub
- ObjNotFoundErr:
- MsgBox "A ComboBox object is not selected."
- End Sub
- Private Sub btnObjItem_Click()
- Dim ItemText As String
- Dim ObjID As Long
- On Error GoTo ObjNotFoundErr
- ObjID = F1Book1.ObjSelection(0)
- nItem = InputBox("Enter the index of the item you wish to return.")
- ItemText = F1Book1.ObjItem(ObjID, nItem)
- MsgBox "Item is: " & ItemText
- Exit Sub
- ObjNotFoundErr:
- MsgBox "Must have a combobox selected or choose a proper index."
- End Sub
- Private Sub btnObjItems_Click()
- Dim ItemText As String
- Dim ObjID As Long
- On Error GoTo ObjNotFoundErr
- ObjID = F1Book1.ObjSelection(0)
-
- ItemText = F1Book1.ObjItems(ObjID)
- MsgBox "The item list is: " & ItemText
- Exit Sub
- ObjNotFoundErr:
- MsgBox "Must have a combobox selected or choose a proper index."
- End Sub
- Private Sub btnObjNameDlg_Click()
- On Error GoTo ObjNotFoundErr
- F1Book1.ObjNameDlg
- Exit Sub
- ObjNotFoundErr:
- MsgBox "An object must be selected."
- End Sub
- Private Sub btnObjNameToID_Click()
- Dim ObjID As Long
- Dim Name As String
- On Error GoTo ObjNotFoundErr
- Name = InputBox("Enter the name of the object.")
- ObjID = F1Book1.ObjNameToID(Name)
- MsgBox "The object " & Name & " has an ObjID of " & ObjID
- Exit Sub
- ObjNotFoundErr:
- MsgBox "That object was not found."
- End Sub
- Private Sub btnObjNew_Click()
- Dim ObjID As Long
- Form3.Show 1
- Select Case F1Book1.Tag
- Case "Line"
- ObjType = F1ObjLine
- Case "Rectangle"
- ObjType = F1ObjRectangle
- Case "Oval"
- ObjType = F1ObjOval
- Case "Arc"
- ObjType = F1ObjArc
- Case "Button"
- ObjType = F1ObjButton
- Case "CheckBox"
- ObjType = F1ObjCheckBox
- Case "ComboBox"
- ObjType = F1ObjDropDown
- Case "Chart"
- ObjType = F1ObjChart
- Case "Cancel"
- Exit Sub
- End Select
- nX1 = 1
- nY1 = 1
- nX2 = 3
- nY2 = 3
- F1Book1.ObjNew ObjType, nX1, nY1, nX2, nY2, ObjID
- End Sub
- Private Sub btnObjNewPicture_Click()
- Dim ObjID As Long
- Dim nX1 As Single
- Dim nY1 As Single
- Dim nX2 As Single
- Dim nY2 As Single
- Dim hMF As OLE_HANDLE
- Dim nMapMode As Long
- Dim nWndExtentX As Long
- Dim nWndExtentY As Long
- Dim MapMode As Integer
- nX1 = 1
- nY1 = 7
- nX2 = 4
- nY2 = 12
- MapMode = MsgBox("Do you wish to strecth the image to fit?", vbYesNo)
- If MapMode = vbYes Then
- nMapMode = 8
- Else
- nMapMode = 7
- End If
- hMF = Picture1.Picture
- nWndExtentX = Picture1.ScaleWidth
- nWndExtentY = Picture1.ScaleHeight
- F1Book1.ObjNewPicture nX1, nY1, nX2, nY2, ObjID, hMF, nMapMode, nWndExtentX, nWndExtentY
- End Sub
- Private Sub btnObjNewPolygon_Click()
- Dim ObjID As Long
- Dim X1 As Single
- Dim Y1 As Single
- Dim X2 As Single
- Dim Y2 As Single
- Dim ArrayX(5) As Variant
- Dim ArrayY(5) As Variant
- Dim pClosed As Boolean
- X1 = 1
- Y1 = 1
- X2 = 5
- Y2 = 5
- ArrayX(1) = 1
- ArrayX(2) = 8000
- ArrayX(3) = 15000
- ArrayX(4) = 16000
- ArrayX(5) = 4000
- ArrayY(1) = 1
- ArrayY(2) = 10000
- ArrayY(3) = 13000
- ArrayY(4) = 11000
- ArrayY(5) = 800
- pClosed = True
- F1Book1.ObjNewPolygon X1, Y1, X2, Y2, ObjID, ArrayX, ArrayY, pClosed
- End Sub
- Private Sub btnObjNextID_Click()
- On Error GoTo ObjNotFoundErr
- MsgBox "The ID of the first object is " & F1Book1.ObjFirstID
-
- ObjCount = F1Book1.ObjFirstID
- While F1Book1.ObjNextID(ObjCount)
- MsgBox "The ID of the next object is " & F1Book1.ObjNextID(ObjCount)
- ObjCount = F1Book1.ObjNextID(ObjCount)
- Wend
- Exit Sub
- ObjNotFoundErr:
- MsgBox "No more objects available."
- End Sub
- Private Sub btnObjOptionsDlg_Click()
- On Error GoTo ObjNotValidErr
- F1Book1.ObjOptionsDlg
- Exit Sub
- ObjNotValidErr:
- MsgBox "The object is not valid for the options dialog."
- End Sub
- Private Sub btnObjPatternBG_Click()
- Dim Red As Integer
- Dim Green As Integer
- Dim Blue As Integer
- On Error GoTo ObjNotFoundErr
- Red = InputBox("Enter the Red value 0-255:")
- Green = InputBox("Enter the Green value 0-255:")
- Blue = InputBox("Enter the Blue value 0-255:")
- F1Book1.ObjPatternBG = RGB(Red, Green, Blue)
- Exit Sub
- ObjNotFoundErr:
- MsgBox "An object must be selected."
- End Sub
- Private Sub btnObjPatternFG_Click()
- Dim Red As Integer
- Dim Green As Integer
- Dim Blue As Integer
- On Error GoTo ObjNotFoundErr
- Red = InputBox("Enter the Red value 0-255:")
- Green = InputBox("Enter the Green value 0-255:")
- Blue = InputBox("Enter the Blue value 0-255:")
- F1Book1.ObjPatternFG = RGB(Red, Green, Blue)
- Exit Sub
- ObjNotFoundErr:
- MsgBox "An object must be selected."
- End Sub
- Private Sub btnObjPatternStyle_Click()
- On Error GoTo ObjNotFoundErr
- Style = InputBox("Enter the style value 1-18:")
- F1Book1.ObjPatternStyle = Style
- Exit Sub
- ObjNotFoundErr:
- MsgBox "An object must be selected."
- End Sub
- Private Sub btnObjPosShown_Click()
- Dim ObjID As Long
- Dim pX1 As Single
- Dim pY1 As Single
- Dim pX2 As Single
- Dim pY2 As Single
- Dim Shown As Integer
- On Error GoTo ObjNotFoundErr
- ObjID = F1Book1.ObjSelection(0)
-
- F1Book1.ObjGetPos ObjID, pX1, pY1, pX2, pY2
- Shown = F1Book1.ObjPosShown(pX1, pY1, pX2, pY2)
- If Shown = 0 Then
- MsgBox "The object is not shown."
- ElseIf Shown = 1 Then
- MsgBox "The object is shown."
- Else
- MsgBox "The object is partially shown."
- End If
- Exit Sub
- ObjNotFoundErr:
- MsgBox "An object must be selected first."
- End Sub
- Private Sub btnObjPosToTwips_Click()
- Dim ObjID As Long
- Dim pX1 As Single
- Dim pY1 As Single
- Dim pX2 As Single
- Dim pY2 As Single
- Dim pX As Long
- Dim pY As Long
- Dim pCX As Long
- Dim pCY As Long
- Dim Shown As Integer
- On Error GoTo ObjNotFoundErr
- ObjID = F1Book1.ObjSelection(0)
-
- F1Book1.ObjGetPos ObjID, pX1, pY1, pX2, pY2
- F1Book1.ObjPosToTwips pX1, pY1, pX2, pY2, pX, pY, pCX, pCY, Shown
- If Shown = 0 Then
- MsgBox "The object is not shown. Its location is at: " & pY & ", " & pX & ", Its dimensions are: " & pCY & ", " & pCX
- ElseIf Shown = 1 Then
- MsgBox "The object is shown. Its location is at: " & pY & ", " & pX & ", Its dimensions are: " & pCY & ", " & pCX
- Else
- MsgBox "The object is partially shown. Its location is at: " & pY & ", " & pX & ", Its dimensions are: " & pCY & ", " & pCX
- End If
- Exit Sub
- ObjNotFoundErr:
- MsgBox "An object must be selected first."
- End Sub
- Private Sub btnObjPosToTwipsEx_Click()
- Dim ObjID As Long
- Dim pX1 As Single
- Dim pY1 As Single
- Dim pX2 As Single
- Dim pY2 As Single
- Dim F1Pos As F1Rect
- Dim Shown As Integer
- On Error GoTo ObjNotFoundErr
- ObjID = F1Book1.ObjSelection(0)
-
- F1Book1.ObjGetPos ObjID, pX1, pY1, pX2, pY2
- Set F1Pos = F1Book1.ObjPosToTwipsEx(pX1, pY1, pX2, pY2)
- MsgBox "The object is at: " & F1Pos.Top & ", " & F1Pos.Left & ", Its dimensions are: " & F1Pos.Height & ", " & F1Pos.Width
- Exit Sub
- ObjNotFoundErr:
- MsgBox "An object must be selected first."
- End Sub
- Private Sub btnObjSendToBack_Click()
- On Error GoTo ObjNotFoundErr
-
- F1Book1.ObjSendToBack
- Exit Sub
- ObjNotFoundErr:
- MsgBox "An object must be selected."
- End Sub
- Private Sub btnObjSetCell_Click()
- Dim ObjID As Long
- Dim CellType As Integer
- Dim nRow As Long
- Dim nCol As Long
- On Error GoTo ObjNotFoundErr
- F1Book1.ObjGetSelection 0, ObjID
- If F1Book1.ObjGetType(ObjID) = F1ObjDropDown Then
- CellType = 2
- nRow = InputBox("Enter the Row:")
- nCol = InputBox("Enter the Column:")
- F1Book1.ObjSetCell ObjID, CellType, nRow, nCol
- Else
- GoTo ObjNotFoundErr
- End If
- Exit Sub
- ObjNotFoundErr:
- MsgBox "A ComboBox object is not selected."
- End Sub
- Private Sub btnObjSetPicture_Click()
- Dim ObjID As Long
- Dim hMF As OLE_HANDLE
- Dim nMapMode As Long
- Dim nWndExtentX As Long
- Dim nWndExtentY As Long
- Dim MapMode As Integer
-
- On Error GoTo ObjNotFoundErr
- ObjID = F1Book1.ObjSelection(0)
-
- MapMode = MsgBox("Do you wish to strecth the image to fit?", vbYesNo)
- If MapMode = vbYes Then
- nMapMode = 8
- Else
- nMapMode = 7
- End If
- hMF = Picture2.Picture
- nWndExtentX = Picture2.ScaleWidth
- nWndExtentY = Picture2.ScaleHeight
- F1Book1.ObjSetPicture ObjID, hMF, nMapMode, nWndExtentX, nWndExtentY
- Exit Sub
- ObjNotFoundErr:
- MsgBox "A Picture control was not selected."
- End Sub
- Private Sub btnObjSetPolygonPoints_Click()
- Dim ObjID As Long
- Dim ArrayX(5) As Variant
- Dim ArrayY(5) As Variant
- Dim pClosed As Boolean
- X1 = 1
- Y1 = 1
- X2 = 5
- Y2 = 5
- ArrayX(1) = 1
- ArrayX(2) = 200
- ArrayX(3) = 8000
- ArrayX(4) = 6000
- ArrayX(5) = 2000
- ArrayY(1) = 1
- ArrayY(2) = 10000
- ArrayY(3) = 13000
- ArrayY(4) = 11000
- ArrayY(5) = 800
- pClosed = True
- On Error GoTo ObjNotFoundErr
- ObjID = F1Book1.ObjSelection(0)
- If F1Book1.ObjGetType(ObjID) = F1ObjPolygon Then
- F1Book1.ObjSetPolygonPoints ObjID, ArrayX, ArrayY, bClosed
- Else
- MsgBox "No Polygon was selected."
- End If
- Exit Sub
- ObjNotFoundErr:
- MsgBox "No Polygon was selected."
- End Sub
- Private Sub btnObjSetPos_Click()
- Dim ObjID As Long
- Dim nX1 As Single
- Dim nY1 As Single
- Dim nX2 As Single
- Dim nY2 As Single
- On Error GoTo ObjNotFoundErr
- ObjID = F1Book1.ObjSelection(0)
- nY1 = InputBox("Enter row for top of object:")
- nX1 = InputBox("Enter column for left of object:")
- nY2 = InputBox("Enter row for bottom of object:")
- nX2 = InputBox("Enter column for right of object:")
- F1Book1.ObjSetPos ObjID, nX1, nY1, nX2, nY2
- Exit Sub
- ObjNotFoundErr:
- MsgBox "An object must be selected first."
- End Sub
- Private Sub btnObjSetSelection_Click()
- Dim ObjID As Long
- On Error GoTo ObjNotFoundErr
- ObjID = InputBox("Enter the ObjID of the object you wish to select.")
- F1Book1.ObjSetSelection ObjID
- Exit Sub
- ObjNotFoundErr:
- MsgBox "That object was not found."
- End Sub
- Private Sub btnObjText_Click()
- Dim ObjID As Long
- On Error GoTo ObjNotFoundErr
- ObjID = F1Book1.ObjSelection(0)
- F1Book1.ObjText(ObjID) = InputBox("Change the text from " & F1Book1.ObjText(ObjID) & " to:")
- Exit Sub
- ObjNotFoundErr:
- MsgBox "A Checkbox or button object must be selected."
- End Sub
- Private Sub btnObjValue_Click()
- Dim ObjID As Long
- On Error GoTo ObjNotFoundErr
- ObjID = F1Book1.ObjSelection(0)
- F1Book1.ObjValue(ObjID) = InputBox("Change the text from " & F1Book1.ObjValue(ObjID) & " to:")
- Exit Sub
- ObjNotFoundErr:
- MsgBox "A Checkbox or Combobox object must be selected."
- End Sub
- Private Sub btnObjVisible_Click()
- Dim ObjID As Long
- On Error GoTo ObjNotFoundErr
- ObjID = InputBox("Enter the ObjID of the object you wish to toggle the visible state:")
- F1Book1.ObjVisible(ObjID) = Not F1Book1.ObjVisible(ObjID)
- Exit Sub
- ObjNotFoundErr:
- MsgBox "That object was not found."
- End Sub
- Private Sub btnOval_Click()
- F1Book1.Mode = F1ModeOval
- End Sub
- Private Sub btnPolygon_Click()
- F1Book1.Mode = F1ModePolygon
- End Sub
- Private Sub btnRectangle_Click()
- F1Book1.Mode = F1ModeRectangle
- End Sub
- Private Sub Command1_Click()
- Dim ObjID As Long
- On Error GoTo ObjNotFoundErr
- ObjID = F1Book1.ObjSelection(0)
- F1Book1.ObjValue(ObjID) = InputBox("Change the text from " & F1Book1.ObjValue(ObjID) & " to:")
- Exit Sub
- ObjNotFoundErr:
- MsgBox "A Checkbox or Combobox object must be selected."
- End Sub
- Private Sub mnuOptions_Click()
- F1Book1.FormatObjectDlg F1AllPages
- End Sub
-