home *** CD-ROM | disk | FTP | other *** search
- Type ButtonMasterForm From SampleMasterForm
- Dim Label1 As New Label
- Dim Label3 As New Label
- Dim Label4 As New Label
- Dim Label5 As New Label
- Dim Label6 As New Label
- Dim btnSize As New Button
- Dim btnCaption As New Button
- Dim btnMove As New Button
- Dim btnTom As New Button
- Dim btnDick As New Button
- Dim btnHarry As New Button
- Dim btnCalm As New Button
- Dim btnHappy As New Button
- Dim btnExcited As New Button
- Dim FaceImage As New Image
- Dim Face1Bitmap As New Bitmap
- Dim Face2Bitmap As New Bitmap
- Dim Face3Bitmap As New Bitmap
- Dim Face4Bitmap As New Bitmap
- Dim btnAngry As New Button
- Dim lblHideMessage As New Label
-
- ' METHODS for object: ButtonMasterForm
- Sub btnTom_Click()
- btnDick.Visible = "True"
- btnHarry.Visible = "True"
- btnTom.Visible = "False"
- lblHideMessage.Caption = "Tom's Disappeared!"
- End Sub
-
- Sub btnDick_Click()
- btnDick.Visible = "False"
- btnHarry.Visible = "True"
- btnTom.Visible = "True"
- lblHideMessage.Caption = "Anyone seen Dick?"
- End Sub
-
- Sub btnHarry_Click()
- btnDick.Visible = "True"
- btnHarry.Visible = "False"
- btnTom.Visible = "True"
- lblHideMessage.Caption = "Where in the world is Harry?"
- End Sub
-
- Sub btnMove_Click()
- Dim cur_location As Integer
- cur_location = btnMove.Left
- Select Case cur_location
- Case 600
- btnMove.Left = 1600
- Case 1600
- btnMove.Left = 2600
- Case 2600
- btnMove.Left = 3600
- Case 3600
- btnMove.Left = 4600
- Case 4600
- btnMove.Left = 5600
- Case 5600
- btnMove.Left = 600
- End Select
- End Sub
-
- Sub btnCaption_Click()
- Dim count As Integer
- Dim first_paren As Integer
- Dim start_pos As Integer
- Dim second_paren As Integer
- Dim click_number As Integer
-
- If btnCaption.Caption == "" Then
- btnCaption.Caption = "I've been clicked (1) time."
- Else
- ' Figure out how many times the button has been clicked
- first_paren = Instr(btnCaption.Caption, "(")
- start_pos = first_paren + 1
- second_paren = Instr(start_pos, btnCaption.Caption, ")")
- click_number = Val(Mid(btnCaption.Caption, start_pos, second_paren - start_pos))
- click_number = click_number + 1
- btnCaption.Caption = "I've been clicked (" & click_number & ") times."
- End If
- End Sub
-
- Sub btnSize_Click()
-
- If btnSize.Top < 75 Then
- btnSize.Left = 5700
- btnSize.Top = 450
- btnSize.Width = 300
- btnSize.Height = 300
- Else
- btnSize.Left = btnSize.Left - 75
- btnSize.Top = btnSize.Top - 75
- btnSize.Width = btnSize.Width + 150
- btnSize.Height = btnSize.Height + 150
- End If
-
- End Sub
-
- Sub btnAngry_Click()
- ' Set the name of the icon file
- FaceImage.Picture = Face4Bitmap
- FaceImage.Refresh
- End Sub
-
- Sub btnCalm_Click()
- ' Set the name of the icon file
- FaceImage.Picture = Face1Bitmap
- FaceImage.Refresh
- End Sub
-
- Sub btnExcited_Click()
- ' Set the name of the icon file
- FaceImage.Picture = Face3Bitmap
- FaceImage.Refresh
- End Sub
-
- Sub btnHappy_Click()
- ' Set the name of the icon file
- FaceImage.Picture = Face2Bitmap
- FaceImage.Refresh
- End Sub
-
- Sub ResetApplication_Click ()
- ' Setup Demo #1
- btnSize.Left = 5700
- btnSize.Top = 450
- btnSize.Width = 300
- btnSize.Height = 300
-
- ' Setup Demo #2
- btnCaption.Caption = ""
-
- ' Setup Demo #3
- btnMove.Left = 600
-
- ' Setup Demo #4
- lblHideMessage.Caption = ""
- btnTom.Visible = "True"
- btnDick.Visible = "True"
- btnHarry.Visible = "True"
-
- ' Setup Demo #5
- FaceImage.Picture = Face1Bitmap
- FaceImage.Refresh
-
- End Sub
-
- End Type
-
- Begin Code
- ' Reconstruction commands for object: ButtonMasterForm
- '
- With ButtonMasterForm
- .Caption := "Button Demonstration"
- .Move(6165, 300, 7605, 6825)
- .SampleDir := "W:\bootcamp\basic\buttons\"
- .SampleName := "buttons"
- With .Label1
- .Caption := "1. Click to change button size."
- .ForeColor := 13107200
- .ZOrder := 1
- .Move(300, 300, 3450, 300)
- End With 'ButtonMasterForm.Label1
- With .Label3
- .Caption := "2. Click to change button caption."
- .ForeColor := 13107200
- .ZOrder := 2
- .Move(300, 1350, 3450, 300)
- End With 'ButtonMasterForm.Label3
- With .Label4
- .Caption := "3. Click to move button."
- .ForeColor := 13107200
- .ZOrder := 3
- .Move(300, 1950, 3450, 300)
- End With 'ButtonMasterForm.Label4
- With .Label5
- .Caption := "4. Click to hide button."
- .ForeColor := 13107200
- .ZOrder := 4
- .Move(300, 3150, 2250, 300)
- End With 'ButtonMasterForm.Label5
- With .Label6
- .Caption := "5. Click to change expression."
- .ForeColor := 13107200
- .ZOrder := 5
- .Move(300, 4650, 3450, 300)
- End With 'ButtonMasterForm.Label6
- With .btnSize
- .ZOrder := 6
- .Move(5700, 450, 300, 300)
- End With 'ButtonMasterForm.btnSize
- With .btnCaption
- .ZOrder := 7
- .Move(4200, 1200, 3000, 450)
- End With 'ButtonMasterForm.btnCaption
- With .btnMove
- .Caption := "Move Me"
- .ZOrder := 8
- .Move(600, 2400, 1200, 450)
- End With 'ButtonMasterForm.btnMove
- With .btnTom
- .Caption := "Tom"
- .ZOrder := 9
- .Move(600, 3600, 1500, 450)
- End With 'ButtonMasterForm.btnTom
- With .btnDick
- .Caption := "Dick"
- .ZOrder := 10
- .Move(3150, 3600, 1500, 450)
- End With 'ButtonMasterForm.btnDick
- With .btnHarry
- .Caption := "Harry"
- .ZOrder := 11
- .Move(5700, 3600, 1500, 450)
- End With 'ButtonMasterForm.btnHarry
- With .btnCalm
- .Caption := "Calm"
- .ZOrder := 12
- .Move(600, 5400, 900, 450)
- End With 'ButtonMasterForm.btnCalm
- With .btnHappy
- .Caption := "Happy"
- .ZOrder := 13
- .Move(1650, 5400, 900, 450)
- End With 'ButtonMasterForm.btnHappy
- With .btnExcited
- .Caption := "Excited"
- .ZOrder := 14
- .Move(2700, 5400, 900, 450)
- End With 'ButtonMasterForm.btnExcited
- With .FaceImage
- .Caption := "FaceImage"
- .ZOrder := 15
- .Move(4050, 4500, 480, 480)
- .BevelOuter := "None"
- .Picture := ButtonMasterForm.Face1Bitmap
- End With 'ButtonMasterForm.FaceImage
- With .Face1Bitmap
- .LoadType := "MemoryBased"
- .FileName := "buttons.ero"
- .ResId := 0
- End With 'ButtonMasterForm.Face1Bitmap
- With .Face2Bitmap
- .LoadType := "MemoryBased"
- .FileName := "buttons.ero"
- .ResId := 628
- End With 'ButtonMasterForm.Face2Bitmap
- With .Face3Bitmap
- .LoadType := "MemoryBased"
- .FileName := "buttons.ero"
- .ResId := 1256
- End With 'ButtonMasterForm.Face3Bitmap
- With .Face4Bitmap
- .LoadType := "MemoryBased"
- .FileName := "buttons.ero"
- .ResId := 1884
- End With 'ButtonMasterForm.Face4Bitmap
- With .btnAngry
- .Caption := "Angry"
- .ZOrder := 16
- .Move(3750, 5400, 900, 450)
- End With 'ButtonMasterForm.btnAngry
- With .lblHideMessage
- .ZOrder := 17
- .Move(2850, 3150, 4350, 300)
- End With 'ButtonMasterForm.lblHideMessage
- With .helpfile
- .FileName := "W:\bootcamp\basic\buttons\buttons.hlp"
- End With 'ButtonMasterForm.helpfile
- End With 'ButtonMasterForm
- End Code
-