home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Tool Box
/
SIMS_2.iso
/
vb_code1
/
blun20
/
generapp.frm
< prev
next >
Wrap
Text File
|
1993-12-23
|
14KB
|
375 lines
VERSION 2.00
Begin Form Balloon_Form
Caption = "BALLOON Test"
ClientHeight = 6510
ClientLeft = 1035
ClientTop = 1845
ClientWidth = 5085
ClipControls = 0 'False
Height = 7200
Left = 975
LinkTopic = "Form1"
ScaleHeight = 6510
ScaleWidth = 5085
Top = 1215
Width = 5205
Begin Balloon Balloon1
BackColor = &H00C0C0C0&
Prop13 = -1 'True
Prop14 = 3 'Rounded
ForeColor = &H000000FF&
Prop12 = 0 'False
Left = 2400
TimeOut = 24000
Top = 3360
End
Begin ComboBox Combo1
Height = 300
Left = 240
TabIndex = 15
Tag = "Combo1 tag text"
Text = "Combo1"
Top = 2880
Width = 2175
End
Begin CommandButton BTN_Dialog
Caption = "Dialog"
Height = 375
Left = 240
TabIndex = 14
Tag = "BTN_Dialog tag text"
Top = 240
Width = 1335
End
Begin OptionButton Option3
Caption = "Maybe option"
Height = 255
Left = 1200
TabIndex = 13
Tag = "Option3 tag text"
Top = 4320
Width = 1575
End
Begin PictureBox Picture1
AutoSize = -1 'True
ClipControls = 0 'False
Height = 360
Left = 360
Picture = GENERAPP.FRX:0000
ScaleHeight = 330
ScaleWidth = 360
TabIndex = 12
Tag = "Picture1 tag text"
Top = 3600
Width = 390
End
Begin CheckBox Check2
Caption = "That"
Height = 255
Left = 1200
TabIndex = 11
Tag = "Check2 tag text"
Top = 3840
Width = 1200
End
Begin CheckBox Check1
Caption = "This"
Height = 255
Left = 1200
TabIndex = 10
Tag = "Check1 tag text"
Top = 3360
Width = 1200
End
Begin Frame Frame1
Caption = "Do it now"
Height = 1215
Left = 3000
TabIndex = 7
Tag = "Frame1 tag text"
Top = 3120
Width = 1695
Begin OptionButton Option2
Caption = "No"
Height = 255
Left = 240
TabIndex = 9
Tag = "Option2 tag text"
Top = 720
Width = 1000
End
Begin OptionButton Option1
Caption = "Yes"
Height = 255
Left = 240
TabIndex = 8
Tag = "Option1 tag text"
Top = 360
Width = 1000
End
End
Begin TextBox TXT_Result
Height = 1575
Left = 120
MultiLine = -1 'True
TabIndex = 6
Tag = "TXT_Result tag text"
Text = "Status output"
Top = 4800
Width = 4815
End
Begin TextBox TXT_KeyString
Height = 375
Left = 120
TabIndex = 3
Tag = "TXT_KeyString tag text."
Text = "This is a popup message to display in the window. The message can be of long length, or it can be short."
Top = 1440
Width = 4815
End
Begin CommandButton BTN_Exit
Caption = "Exit"
Height = 375
Left = 3480
TabIndex = 2
Tag = "BTN_Exit tag text"
Top = 240
Width = 1455
End
Begin TextBox TXT_SearchString
Height = 375
Left = 120
TabIndex = 1
Tag = "TXT_SearchString tag text"
Text = "Dawg"
Top = 2280
Width = 4815
End
Begin CommandButton Btn_HelpSession
Caption = "Help Balloons"
Height = 375
Left = 1800
TabIndex = 0
Tag = "Btn_HelpSession tag text"
Top = 240
Width = 1455
End
Begin Label Label3
Alignment = 2 'Center
Caption = "Search String"
Height = 255
Left = 120
TabIndex = 5
Top = 1920
Width = 4815
End
Begin Label Label1
Alignment = 2 'Center
Caption = "Key String"
Height = 255
Left = 120
TabIndex = 4
Top = 1080
Width = 4815
End
Begin Menu nmu_File
Caption = "&File"
Begin Menu mnu_Exit
Caption = "&Exit"
End
End
Begin Menu mnu_Edit
Caption = "&Edit"
Begin Menu mnu_Cut
Caption = "Cu&t"
End
Begin Menu mnu_Copy
Caption = "&Copy"
End
Begin Menu mnu_Paste
Caption = "&Paste"
End
Begin Menu mnu_submenu
Caption = "SubMenu"
Begin Menu mnu_submenu1
Caption = "SubMenu 1"
End
Begin Menu mnu_submenu2
Caption = "SubMenu 2"
End
End
End
Begin Menu mnu_help
Caption = "&Help"
Begin Menu mnu_HelpBalloons
Caption = "Help &Balloons"
End
End
End
Option Explicit
' Declare statements for utility functions included in BALLOON.VBX
Declare Function Hwnd2ControlTabIndex Lib "BALLOON.VBX" (ByVal hwndControl%) As Integer
Declare Function Hwnd2CtlName Lib "BALLOON.VBX" (ByVal hwndControl%) As String
Declare Function Hwnd2HelpContextID Lib "BALLOON.VBX" (ByVal hwndControl%) As Long
Declare Function Hwnd2TagText Lib "BALLOON.VBX" (ByVal hwndControl%) As String
Sub Balloon1_BalloonClick (hwndAtMouse As Integer)
' PURPOSE: hwndAtMouse is the control the mouse is over
' COMMENTS: pass back the help text
' shows how to programmatcially end a session
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim Msg As String
Dim CRLF As String
Dim TestText As String
CRLF = Chr$(13) + Chr$(10)
TestText = "Use the balloon utility functions to retrieve other control properties. Display these properties in the ballon if desired." + CRLF
TestText = TestText + "CtlName = " + Hwnd2CtlName(hwndAtMouse) + CRLF
TestText = TestText + "Tag text = " + Hwnd2TagText(hwndAtMouse) + CRLF
TestText = TestText + "HelpContextID = " + Str$(Hwnd2HelpContextID(hwndAtMouse)) + CRLF
TestText = TestText + "ControlTabIndex = " + Str$(Hwnd2ControlTabIndex(hwndAtMouse))
TXT_Result.Text = TestText
Select Case hwndAtMouse
Case Me.hWnd
Exit Sub ' do nothing
Case BTN_Dialog.hWnd
'TestText = Hwnd2TagText$(hwndAtMouse)
'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + " " + TestText
' set font and back colors dynamically
Balloon1.ForeColor = QBColor(0)
Balloon1.BackColor = QBColor(2)
Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control BTN_Dialog."
Case Btn_HelpSession.hWnd
'TestText = Hwnd2TagText$(hwndAtMouse)
'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + " " + TestText
' set font and back colors dynamically
Balloon1.ForeColor = &HFF0000 ' blue
Balloon1.BackColor = &HC0C0C0 ' light grey
Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Btn_HelpSession."
Case BTN_Exit.hWnd
'TestText = Hwnd2TagText$(hwndAtMouse)
'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + " " + TestText
' set font and back colors dynamically
Balloon1.ForeColor = QBColor(4)
Balloon1.BackColor = QBColor(14)
Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control BTN_Exit."
Case TXT_KeyString.hWnd
'TestText = Hwnd2TagText$(hwndAtMouse)
'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + " " + TestText
Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control TXT_KeyString."
Case TXT_SearchString.hWnd
'TestText = Hwnd2TagText$(hwndAtMouse)
'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + " " + TestText
Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control TXT_SearchString."
Case TXT_Result.hWnd
'TestText = Hwnd2TagText$(hwndAtMouse)
'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + " " + TestText
Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control TXT_Result."
Case Picture1.hWnd
'TestText = Hwnd2TagText$(hwndAtMouse)
'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + " " + TestText
Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Picture1."
Case Check1.hWnd
'TestText = Hwnd2TagText$(hwndAtMouse)
'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + " " + TestText
Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Check1."
Case Check2.hWnd
'TestText = Hwnd2TagText$(hwndAtMouse)
'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + " " + TestText
Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Check2."
Case Frame1.hWnd
'TestText = Hwnd2TagText$(hwndAtMouse)
'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + " " + TestText
Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Frame1."
Case Option1.hWnd
'TestText = Hwnd2TagText$(hwndAtMouse)
'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + " " + TestText
Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Option1."
Case Option2.hWnd
'TestText = Hwnd2TagText$(hwndAtMouse)
'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + " " + TestText
Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Option2."
Case Option3.hWnd
'TestText = Hwnd2TagText$(hwndAtMouse)
'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + " " + TestText
Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Option3."
Case Combo1.hWnd
'TestText = Hwnd2TagText$(hwndAtMouse)
'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + " " + TestText
Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Combo1."
Case Else
End Select
End Sub
Sub BTN_Dialog_Click ()
Dialog.Show
End Sub
Sub BTN_Exit_Click ()
mnu_Exit_Click
End Sub
Sub Btn_HelpSession_Click ()
' initial help text string
' here we get the text from the on screen text box
'
' Initial text can be left blank, if blank then
' Balloon.vbx control will display an internal init message
Balloon1.MessageText = TXT_KeyString.Text
Balloon1.Action = 20 ' Balloon_START = 20
End Sub
Sub Form_Load ()
If Me.WindowState = 0 Then
Me.Top = 0
Me.Left = 0
End If
End Sub
Sub Form_Resize ()
If Me.WindowState = 0 Then
Me.Height = 7200
Me.Width = 5175
End If
End Sub
Sub mnu_Exit_Click ()
End
End Sub
Sub mnu_HelpBalloons_Click ()
' initial help text string
' here we get the text from the on screen text box
'
' Initial text can be left blank, if blank then
' Balloon.vbx control will display an internal init message
Balloon1.MessageText = TXT_KeyString.Text
Balloon1.Action = 20 ' Balloon_START = 20
End Sub