home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_1 / BLUN20 / GENERAPP.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-12-23  |  13.5 KB  |  354 lines

  1. VERSION 2.00
  2. Begin Form Balloon_Form 
  3.    Caption         =   "BALLOON Test"
  4.    ClientHeight    =   6510
  5.    ClientLeft      =   1035
  6.    ClientTop       =   1845
  7.    ClientWidth     =   5085
  8.    ClipControls    =   0   'False
  9.    Height          =   7200
  10.    Left            =   975
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   6510
  13.    ScaleWidth      =   5085
  14.    Top             =   1215
  15.    Width           =   5205
  16.    Begin Balloon Balloon1 
  17.       BackColor       =   &H00C0C0C0&
  18.       Prop13          =   -1  'True
  19.       Prop14          =   3  'Rounded
  20.       ForeColor       =   &H000000FF&
  21.       Prop12          =   0   'False
  22.       Left            =   2400
  23.       TimeOut         =   24000
  24.       Top             =   3360
  25.    End
  26.    Begin ComboBox Combo1 
  27.       Height          =   300
  28.       Left            =   240
  29.       TabIndex        =   15
  30.       Tag             =   "Combo1 tag text"
  31.       Text            =   "Combo1"
  32.       Top             =   2880
  33.       Width           =   2175
  34.    End
  35.    Begin CommandButton BTN_Dialog 
  36.       Caption         =   "Dialog"
  37.       Height          =   375
  38.       Left            =   240
  39.       TabIndex        =   14
  40.       Tag             =   "BTN_Dialog tag text"
  41.       Top             =   240
  42.       Width           =   1335
  43.    End
  44.    Begin OptionButton Option3 
  45.       Caption         =   "Maybe option"
  46.       Height          =   255
  47.       Left            =   1200
  48.       TabIndex        =   13
  49.       Tag             =   "Option3 tag text"
  50.       Top             =   4320
  51.       Width           =   1575
  52.    End
  53.    Begin PictureBox Picture1 
  54.       AutoSize        =   -1  'True
  55.       ClipControls    =   0   'False
  56.       Height          =   360
  57.       Left            =   360
  58.       Picture         =   GENERAPP.FRX:0000
  59.       ScaleHeight     =   330
  60.       ScaleWidth      =   360
  61.       TabIndex        =   12
  62.       Tag             =   "Picture1 tag text"
  63.       Top             =   3600
  64.       Width           =   390
  65.    End
  66.    Begin CheckBox Check2 
  67.       Caption         =   "That"
  68.       Height          =   255
  69.       Left            =   1200
  70.       TabIndex        =   11
  71.       Tag             =   "Check2 tag text"
  72.       Top             =   3840
  73.       Width           =   1200
  74.    End
  75.    Begin CheckBox Check1 
  76.       Caption         =   "This"
  77.       Height          =   255
  78.       Left            =   1200
  79.       TabIndex        =   10
  80.       Tag             =   "Check1 tag text"
  81.       Top             =   3360
  82.       Width           =   1200
  83.    End
  84.    Begin Frame Frame1 
  85.       Caption         =   "Do it now"
  86.       Height          =   1215
  87.       Left            =   3000
  88.       TabIndex        =   7
  89.       Tag             =   "Frame1 tag text"
  90.       Top             =   3120
  91.       Width           =   1695
  92.       Begin OptionButton Option2 
  93.          Caption         =   "No"
  94.          Height          =   255
  95.          Left            =   240
  96.          TabIndex        =   9
  97.          Tag             =   "Option2 tag text"
  98.          Top             =   720
  99.          Width           =   1000
  100.       End
  101.       Begin OptionButton Option1 
  102.          Caption         =   "Yes"
  103.          Height          =   255
  104.          Left            =   240
  105.          TabIndex        =   8
  106.          Tag             =   "Option1 tag text"
  107.          Top             =   360
  108.          Width           =   1000
  109.       End
  110.    End
  111.    Begin TextBox TXT_Result 
  112.       Height          =   1575
  113.       Left            =   120
  114.       MultiLine       =   -1  'True
  115.       TabIndex        =   6
  116.       Tag             =   "TXT_Result tag text"
  117.       Text            =   "Status output"
  118.       Top             =   4800
  119.       Width           =   4815
  120.    End
  121.    Begin TextBox TXT_KeyString 
  122.       Height          =   375
  123.       Left            =   120
  124.       TabIndex        =   3
  125.       Tag             =   "TXT_KeyString tag text."
  126.       Text            =   "This is a popup message to display in the window. The message can be of long length, or it can be short."
  127.       Top             =   1440
  128.       Width           =   4815
  129.    End
  130.    Begin CommandButton BTN_Exit 
  131.       Caption         =   "Exit"
  132.       Height          =   375
  133.       Left            =   3480
  134.       TabIndex        =   2
  135.       Tag             =   "BTN_Exit tag text"
  136.       Top             =   240
  137.       Width           =   1455
  138.    End
  139.    Begin TextBox TXT_SearchString 
  140.       Height          =   375
  141.       Left            =   120
  142.       TabIndex        =   1
  143.       Tag             =   "TXT_SearchString tag text"
  144.       Text            =   "Dawg"
  145.       Top             =   2280
  146.       Width           =   4815
  147.    End
  148.    Begin CommandButton Btn_HelpSession 
  149.       Caption         =   "Help Balloons"
  150.       Height          =   375
  151.       Left            =   1800
  152.       TabIndex        =   0
  153.       Tag             =   "Btn_HelpSession tag text"
  154.       Top             =   240
  155.       Width           =   1455
  156.    End
  157.    Begin Label Label3 
  158.       Alignment       =   2  'Center
  159.       Caption         =   "Search String"
  160.       Height          =   255
  161.       Left            =   120
  162.       TabIndex        =   5
  163.       Top             =   1920
  164.       Width           =   4815
  165.    End
  166.    Begin Label Label1 
  167.       Alignment       =   2  'Center
  168.       Caption         =   "Key String"
  169.       Height          =   255
  170.       Left            =   120
  171.       TabIndex        =   4
  172.       Top             =   1080
  173.       Width           =   4815
  174.    End
  175.    Begin Menu nmu_File 
  176.       Caption         =   "&File"
  177.       Begin Menu mnu_Exit 
  178.          Caption         =   "&Exit"
  179.       End
  180.    End
  181.    Begin Menu mnu_Edit 
  182.       Caption         =   "&Edit"
  183.       Begin Menu mnu_Cut 
  184.          Caption         =   "Cu&t"
  185.       End
  186.       Begin Menu mnu_Copy 
  187.          Caption         =   "&Copy"
  188.       End
  189.       Begin Menu mnu_Paste 
  190.          Caption         =   "&Paste"
  191.       End
  192.       Begin Menu mnu_submenu 
  193.          Caption         =   "SubMenu"
  194.          Begin Menu mnu_submenu1 
  195.             Caption         =   "SubMenu 1"
  196.          End
  197.          Begin Menu mnu_submenu2 
  198.             Caption         =   "SubMenu 2"
  199.          End
  200.       End
  201.    End
  202.    Begin Menu mnu_help 
  203.       Caption         =   "&Help"
  204.       Begin Menu mnu_HelpBalloons 
  205.          Caption         =   "Help &Balloons"
  206.       End
  207.    End
  208. Option Explicit
  209. ' Declare statements for utility functions included in BALLOON.VBX
  210. Declare Function Hwnd2ControlTabIndex Lib "BALLOON.VBX" (ByVal hwndControl%) As Integer
  211. Declare Function Hwnd2CtlName Lib "BALLOON.VBX" (ByVal hwndControl%) As String
  212. Declare Function Hwnd2HelpContextID Lib "BALLOON.VBX" (ByVal hwndControl%) As Long
  213. Declare Function Hwnd2TagText Lib "BALLOON.VBX" (ByVal hwndControl%) As String
  214. Sub Balloon1_BalloonClick (hwndAtMouse As Integer)
  215. ' PURPOSE:  hwndAtMouse is the control the mouse is over
  216. ' COMMENTS: pass back the help text
  217. '           shows how to programmatcially end a session
  218. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  219. Dim Msg As String
  220. Dim CRLF As String
  221. Dim TestText As String
  222.     CRLF = Chr$(13) + Chr$(10)
  223.     TestText = "Use the balloon utility functions to retrieve other control properties. Display these properties in the ballon if desired." + CRLF
  224.     TestText = TestText + "CtlName = " + Hwnd2CtlName(hwndAtMouse) + CRLF
  225.     TestText = TestText + "Tag text = " + Hwnd2TagText(hwndAtMouse) + CRLF
  226.     TestText = TestText + "HelpContextID = " + Str$(Hwnd2HelpContextID(hwndAtMouse)) + CRLF
  227.     TestText = TestText + "ControlTabIndex = " + Str$(Hwnd2ControlTabIndex(hwndAtMouse))
  228.     TXT_Result.Text = TestText
  229.     Select Case hwndAtMouse
  230.         Case Me.hWnd
  231.             Exit Sub    ' do nothing
  232.         Case BTN_Dialog.hWnd
  233.             'TestText = Hwnd2TagText$(hwndAtMouse)
  234.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  235.             
  236.             ' set font and back colors dynamically
  237.             Balloon1.ForeColor = QBColor(0)
  238.             Balloon1.BackColor = QBColor(2)
  239.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control BTN_Dialog."
  240.         Case Btn_HelpSession.hWnd
  241.             'TestText = Hwnd2TagText$(hwndAtMouse)
  242.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  243.             
  244.             ' set font and back colors dynamically
  245.             Balloon1.ForeColor = &HFF0000    ' blue
  246.             Balloon1.BackColor = &HC0C0C0    ' light grey
  247.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Btn_HelpSession."
  248.         Case BTN_Exit.hWnd
  249.             'TestText = Hwnd2TagText$(hwndAtMouse)
  250.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  251.             
  252.             ' set font and back colors dynamically
  253.             Balloon1.ForeColor = QBColor(4)
  254.             Balloon1.BackColor = QBColor(14)
  255.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control BTN_Exit."
  256.         Case TXT_KeyString.hWnd
  257.             'TestText = Hwnd2TagText$(hwndAtMouse)
  258.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  259.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control TXT_KeyString."
  260.         Case TXT_SearchString.hWnd
  261.             'TestText = Hwnd2TagText$(hwndAtMouse)
  262.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  263.             
  264.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control TXT_SearchString."
  265.         Case TXT_Result.hWnd
  266.             'TestText = Hwnd2TagText$(hwndAtMouse)
  267.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  268.             
  269.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control TXT_Result."
  270.         Case Picture1.hWnd
  271.             'TestText = Hwnd2TagText$(hwndAtMouse)
  272.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  273.             
  274.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Picture1."
  275.         Case Check1.hWnd
  276.             'TestText = Hwnd2TagText$(hwndAtMouse)
  277.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  278.             
  279.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Check1."
  280.         Case Check2.hWnd
  281.             'TestText = Hwnd2TagText$(hwndAtMouse)
  282.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  283.             
  284.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Check2."
  285.         Case Frame1.hWnd
  286.             'TestText = Hwnd2TagText$(hwndAtMouse)
  287.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  288.             
  289.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Frame1."
  290.         Case Option1.hWnd
  291.             'TestText = Hwnd2TagText$(hwndAtMouse)
  292.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  293.             
  294.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Option1."
  295.         Case Option2.hWnd
  296.             'TestText = Hwnd2TagText$(hwndAtMouse)
  297.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  298.             
  299.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Option2."
  300.         Case Option3.hWnd
  301.             'TestText = Hwnd2TagText$(hwndAtMouse)
  302.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  303.             
  304.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Option3."
  305.         Case Combo1.hWnd
  306.             'TestText = Hwnd2TagText$(hwndAtMouse)
  307.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  308.             
  309.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Combo1."
  310.         Case Else
  311.         
  312.         End Select
  313.         
  314. End Sub
  315. Sub BTN_Dialog_Click ()
  316.     Dialog.Show
  317. End Sub
  318. Sub BTN_Exit_Click ()
  319.     mnu_Exit_Click
  320. End Sub
  321. Sub Btn_HelpSession_Click ()
  322.     ' initial help text string
  323.     ' here we get the text from the on screen text box
  324.     '
  325.     ' Initial text can be left blank, if blank then
  326.     ' Balloon.vbx control will display an internal init message
  327.     Balloon1.MessageText = TXT_KeyString.Text
  328.     Balloon1.Action = 20     ' Balloon_START = 20
  329. End Sub
  330. Sub Form_Load ()
  331.     If Me.WindowState = 0 Then
  332.         Me.Top = 0
  333.         Me.Left = 0
  334.     End If
  335. End Sub
  336. Sub Form_Resize ()
  337.     If Me.WindowState = 0 Then
  338.         Me.Height = 7200
  339.         Me.Width = 5175
  340.     End If
  341. End Sub
  342. Sub mnu_Exit_Click ()
  343.     End
  344. End Sub
  345. Sub mnu_HelpBalloons_Click ()
  346.     ' initial help text string
  347.     ' here we get the text from the on screen text box
  348.     '
  349.     ' Initial text can be left blank, if blank then
  350.     ' Balloon.vbx control will display an internal init message
  351.     Balloon1.MessageText = TXT_KeyString.Text
  352.     Balloon1.Action = 20     ' Balloon_START = 20
  353. End Sub
  354.