home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / activex / demos / oletrial / samples / vb / mhcmbo / mhcmbo.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-11-30  |  27.5 KB  |  708 lines

  1. VERSION 4.00
  2. Begin VB.Form frmMain 
  3.    Caption         =   "MicroHelp Mh3dCombo Example"
  4.    ClientHeight    =   3336
  5.    ClientLeft      =   1224
  6.    ClientTop       =   1992
  7.    ClientWidth     =   5652
  8.    BeginProperty Font 
  9.       name            =   "MS Sans Serif"
  10.       charset         =   0
  11.       weight          =   700
  12.       size            =   7.8
  13.       underline       =   0   'False
  14.       italic          =   0   'False
  15.       strikethrough   =   0   'False
  16.    EndProperty
  17.    ForeColor       =   &H80000008&
  18.    Height          =   3936
  19.    Icon            =   "mhcmbo.frx":0000
  20.    Left            =   1176
  21.    LinkTopic       =   "Form1"
  22.    ScaleHeight     =   3336
  23.    ScaleWidth      =   5652
  24.    Top             =   1440
  25.    Width           =   5748
  26.    Begin VB.Frame fraSearching 
  27.       Caption         =   "The .FindString && .FindInstr properties let you do searches..."
  28.       Height          =   2352
  29.       Left            =   252
  30.       TabIndex        =   4
  31.       Tag             =   "slide frame"
  32.       Top             =   3672
  33.       Visible         =   0   'False
  34.       Width           =   5412
  35.       Begin VB.TextBox txtSearch 
  36.          Height          =   288
  37.          Left            =   792
  38.          MaxLength       =   8
  39.          TabIndex        =   19
  40.          Top             =   684
  41.          Width           =   3432
  42.       End
  43.       Begin VB.CheckBox chkInString 
  44.          Caption         =   "&In-String"
  45.          Height          =   228
  46.          Left            =   3276
  47.          TabIndex        =   16
  48.          Top             =   1728
  49.          Value           =   1  'Checked
  50.          Width           =   1236
  51.       End
  52.       Begin VB.CommandButton cmdSearch 
  53.          Appearance      =   0  'Flat
  54.          BackColor       =   &H80000005&
  55.          Caption         =   "Find &First"
  56.          Enabled         =   0   'False
  57.          BeginProperty Font 
  58.             name            =   "MS Sans Serif"
  59.             charset         =   0
  60.             weight          =   400
  61.             size            =   7.8
  62.             underline       =   0   'False
  63.             italic          =   0   'False
  64.             strikethrough   =   0   'False
  65.          EndProperty
  66.          Height          =   372
  67.          Index           =   0
  68.          Left            =   792
  69.          TabIndex        =   7
  70.          Top             =   1632
  71.          Width           =   1212
  72.       End
  73.       Begin VB.CommandButton cmdSearch 
  74.          Appearance      =   0  'Flat
  75.          BackColor       =   &H80000005&
  76.          Caption         =   "Find &Next"
  77.          Enabled         =   0   'False
  78.          BeginProperty Font 
  79.             name            =   "MS Sans Serif"
  80.             charset         =   0
  81.             weight          =   400
  82.             size            =   7.8
  83.             underline       =   0   'False
  84.             italic          =   0   'False
  85.             strikethrough   =   0   'False
  86.          EndProperty
  87.          Height          =   372
  88.          Index           =   1
  89.          Left            =   1992
  90.          TabIndex        =   6
  91.          Top             =   1632
  92.          Width           =   1212
  93.       End
  94.       Begin VB.Label Label1 
  95.          BackStyle       =   0  'Transparent
  96.          Caption         =   "&Search Text"
  97.          Height          =   228
  98.          Left            =   792
  99.          TabIndex        =   15
  100.          Top             =   468
  101.          Width           =   1344
  102.       End
  103.    End
  104.    Begin VB.Frame fraTipsAndTricks 
  105.       Caption         =   "Tips and Tricks..."
  106.       Height          =   2352
  107.       Left            =   144
  108.       TabIndex        =   5
  109.       Tag             =   "slide frame"
  110.       Top             =   3420
  111.       Visible         =   0   'False
  112.       Width           =   5412
  113.       Begin VB.TextBox txtTipsAndTricks 
  114.          Height          =   1992
  115.          Left            =   108
  116.          Locked          =   -1  'True
  117.          MultiLine       =   -1  'True
  118.          ScrollBars      =   2  'Vertical
  119.          TabIndex        =   18
  120.          Top             =   252
  121.          Width           =   5172
  122.       End
  123.    End
  124.    Begin VB.Frame fraTheLook 
  125.       Caption         =   "The Mh3dCombo control has an enhanced 3D appearance..."
  126.       Height          =   2352
  127.       Left            =   108
  128.       TabIndex        =   3
  129.       Tag             =   "slide frame"
  130.       Top             =   108
  131.       Width           =   5412
  132.       Begin VB.Frame Frame2 
  133.          Caption         =   "&Columns"
  134.          Height          =   672
  135.          Left            =   792
  136.          TabIndex        =   12
  137.          Top             =   396
  138.          Width           =   3432
  139.          Begin VB.CheckBox chkColumnDivider 
  140.             Caption         =   "Divider"
  141.             Height          =   228
  142.             Left            =   2088
  143.             TabIndex        =   14
  144.             Top             =   324
  145.             Width           =   1272
  146.          End
  147.          Begin VB.CheckBox chkMultipleColumns 
  148.             Caption         =   "Multiple Columns"
  149.             Height          =   264
  150.             Left            =   216
  151.             TabIndex        =   13
  152.             Top             =   324
  153.             Width           =   1776
  154.          End
  155.       End
  156.       Begin VB.Frame Frame1 
  157.          Caption         =   "Divider Style"
  158.          Height          =   612
  159.          Left            =   792
  160.          TabIndex        =   8
  161.          Top             =   1548
  162.          Width           =   3432
  163.          Begin VB.OptionButton optDividerStyle 
  164.             Caption         =   "&None"
  165.             Height          =   228
  166.             Index           =   2
  167.             Left            =   2304
  168.             TabIndex        =   11
  169.             Top             =   288
  170.             Width           =   1020
  171.          End
  172.          Begin VB.OptionButton optDividerStyle 
  173.             Caption         =   "&Raised"
  174.             Height          =   228
  175.             Index           =   1
  176.             Left            =   1260
  177.             TabIndex        =   10
  178.             Top             =   288
  179.             Width           =   1020
  180.          End
  181.          Begin VB.OptionButton optDividerStyle 
  182.             Caption         =   "&Lowered"
  183.             Height          =   228
  184.             Index           =   0
  185.             Left            =   144
  186.             TabIndex        =   9
  187.             Top             =   288
  188.             Value           =   -1  'True
  189.             Width           =   1020
  190.          End
  191.       End
  192.    End
  193.    Begin VB.Timer tmrStatusLine 
  194.       Enabled         =   0   'False
  195.       Left            =   468
  196.       Top             =   2592
  197.    End
  198.    Begin VB.CommandButton cmdSlide 
  199.       Appearance      =   0  'Flat
  200.       BackColor       =   &H00D9A8AE&
  201.       Caption         =   "< &Back"
  202.       Enabled         =   0   'False
  203.       BeginProperty Font 
  204.          name            =   "MS Sans Serif"
  205.          charset         =   0
  206.          weight          =   400
  207.          size            =   7.8
  208.          underline       =   0   'False
  209.          italic          =   0   'False
  210.          strikethrough   =   0   'False
  211.       EndProperty
  212.       Height          =   372
  213.       Index           =   0
  214.       Left            =   900
  215.       TabIndex        =   0
  216.       Top             =   2556
  217.       Width           =   1212
  218.    End
  219.    Begin VB.CommandButton cmdSlide 
  220.       Appearance      =   0  'Flat
  221.       BackColor       =   &H00D9A8AE&
  222.       Caption         =   "&Next >"
  223.       Default         =   -1  'True
  224.       BeginProperty Font 
  225.          name            =   "MS Sans Serif"
  226.          charset         =   0
  227.          weight          =   400
  228.          size            =   7.8
  229.          underline       =   0   'False
  230.          italic          =   0   'False
  231.          strikethrough   =   0   'False
  232.       EndProperty
  233.       Height          =   372
  234.       Index           =   1
  235.       Left            =   2100
  236.       TabIndex        =   1
  237.       Top             =   2556
  238.       Width           =   1212
  239.    End
  240.    Begin VB.CommandButton cmdClose 
  241.       Appearance      =   0  'Flat
  242.       BackColor       =   &H00D9A8AE&
  243.       Caption         =   "&Close"
  244.       BeginProperty Font 
  245.          name            =   "MS Sans Serif"
  246.          charset         =   0
  247.          weight          =   400
  248.          size            =   7.8
  249.          underline       =   0   'False
  250.          italic          =   0   'False
  251.          strikethrough   =   0   'False
  252.       EndProperty
  253.       Height          =   372
  254.       Left            =   3420
  255.       TabIndex        =   2
  256.       Top             =   2556
  257.       Width           =   1212
  258.    End
  259.    Begin Threed.SSPanel panStatusLine 
  260.       Height          =   252
  261.       Left            =   72
  262.       TabIndex        =   17
  263.       Top             =   3024
  264.       Width           =   5532
  265.       _Version        =   65536
  266.       _ExtentX        =   9758
  267.       _ExtentY        =   445
  268.       _StockProps     =   15
  269.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  270.          name            =   "MS Sans Serif"
  271.          charset         =   0
  272.          weight          =   400
  273.          size            =   7.8
  274.          underline       =   0   'False
  275.          italic          =   0   'False
  276.          strikethrough   =   0   'False
  277.       EndProperty
  278.       BevelOuter      =   1
  279.    End
  280.    Begin Threed.SSPanel SSPanel1 
  281.       Height          =   24
  282.       Left            =   -1872
  283.       TabIndex        =   20
  284.       Top             =   0
  285.       Width           =   9480
  286.       _Version        =   65536
  287.       _ExtentX        =   16722
  288.       _ExtentY        =   42
  289.       _StockProps     =   15
  290.       Caption         =   "SSPanel1"
  291.       BackColor       =   12038095
  292.       BevelOuter      =   1
  293.    End
  294.    Begin MhgcmbLib.Mh3dCombo Mh3dComboDemo 
  295.       Height          =   264
  296.       Left            =   936
  297.       TabIndex        =   21
  298.       Top             =   1296
  299.       Width           =   3360
  300.       _Version        =   65536
  301.       _ExtentX        =   5927
  302.       _ExtentY        =   466
  303.       _StockProps     =   93
  304.       TintColor       =   16711935
  305.       ColScale        =   2
  306.       LightColor      =   16777215
  307.       PictureHeight   =   0
  308.       PictureWidth    =   0
  309.       Style           =   2
  310.       TitleHeight     =   -1
  311.       TitleColor      =   11619930
  312.       ColWidth0       =   10
  313.    End
  314.    Begin VB.Menu mnuFile 
  315.       Caption         =   "&File"
  316.       Begin VB.Menu mnuFileExit 
  317.          Caption         =   "E&xit"
  318.       End
  319.    End
  320.    Begin VB.Menu mnuAbout 
  321.       Caption         =   "&About..."
  322.    End
  323. Attribute VB_Name = "frmMain"
  324. Attribute VB_Creatable = False
  325. Attribute VB_Exposed = False
  326. Option Explicit ' always
  327. ' number of slide-frames used in demo
  328. Private Const im_TOTAL_NUMBER_OF_SLIDES = 3
  329. Private Sub chkColumnDivider_Click()
  330.     ' turn combox's column divider on/off
  331.     Select Case chkColumnDivider.Value
  332.     Case 0 ' unchecked
  333.         Mh3dComboDemo.ColSizing = 0
  334.     Case 1 ' checked
  335.         Mh3dComboDemo.ColSizing = 3 ' vertical dividers on
  336.     End Select
  337. End Sub
  338. Private Sub chkMultipleColumns_Click()
  339.     ' turn combo box's multiple columns on/off
  340.     Select Case chkMultipleColumns.Value
  341.     Case 0 ' unchecked
  342.         ' load the combo box with one column of items
  343.         Call FillComboBox(False)
  344.         ' do not allow user turn divider on
  345.         chkColumnDivider.Value = 0
  346.         chkColumnDivider.Enabled = False
  347.     Case 1 ' checked
  348.         ' load the combo box with multiple columns
  349.         Call FillComboBox(True)
  350.         ' allow user turn divider on
  351.         chkColumnDivider.Enabled = True
  352.     End Select
  353.     ' select the first item
  354.     Mh3dComboDemo.ListIndex = 0
  355. End Sub
  356. Private Sub cmdClose_Click()
  357.     ' close down this demo
  358.     Unload Me
  359. End Sub
  360. Private Sub cmdSearch_Click(Index As Integer)
  361.     Dim sSearchType As String, sMessage As String
  362.     Dim iFoundSpot As Long, iFindFirstSwitch As Integer
  363.     ' start building the text which will tell user the results of the search
  364.     If Index = 0 Then
  365.         sSearchType = "from beginning using"
  366.         iFindFirstSwitch = True
  367.     Else
  368.         sSearchType = "from current index using"
  369.         iFindFirstSwitch = False
  370.     End If
  371.     ' determine the type of search the the user wants
  372.     Select Case chkInString.Value
  373.     Case 0 ' do String search
  374.         ' do a character by character search
  375.         sSearchType = sSearchType & " full-string"
  376.     Case 1 ' do Instr search
  377.         ' do an instring search
  378.         sSearchType = sSearchType & " in-string"
  379.     End Select
  380.     iFoundSpot = SearchMhListTypeControl(Mh3dComboDemo, (txtSearch.Text), iFindFirstSwitch, (chkInString.Value = 1))
  381.     ' tell user the status of the search
  382.     Select Case iFoundSpot
  383.     Case -1 ' text was not found
  384.         sMessage = "Text '" & txtSearch & "' not found " & sSearchType & " search."
  385.     Case Else ' the text was found
  386.         sMessage = "Text '" & txtSearch & "' found at " & iFoundSpot & " " & sSearchType & " search."
  387.         ' select the found item
  388.         Mh3dComboDemo.ListIndex = iFoundSpot
  389.     End Select
  390.     ' over-ride any other messages on the status line
  391.     Call SetStatusLineText(sMessage, True, 3001)
  392.     ' go back to the text box
  393.     txtSearch.SetFocus
  394. End Sub
  395. Private Sub cmdSlide_Click(Index As Integer)
  396.     Static il_SlideNumber As Integer, il_BeenRunAlready As Integer
  397.     ' if this is the first time being run then set the slide number to 1
  398.     If Not il_BeenRunAlready Then
  399.         il_SlideNumber = 1
  400.         il_BeenRunAlready = True
  401.     End If
  402.     ' determine the button that the user pressed
  403.     Select Case Index
  404.     Case 0 ' Go Back
  405.         il_SlideNumber = il_SlideNumber - 1
  406.     Case 1 ' Go to Next slide
  407.         il_SlideNumber = il_SlideNumber + 1
  408.     End Select
  409.     ' if we are at the first or last slide then enabled/disable the appropriate buttons
  410.     Select Case True
  411.     Case il_SlideNumber <= 1 ' we are at first slide
  412.         il_SlideNumber = 1
  413.         ' disable the 'back' button
  414.         cmdSlide(0).Enabled = False
  415.         cmdSlide(1).SetFocus
  416.     Case il_SlideNumber >= im_TOTAL_NUMBER_OF_SLIDES ' we are at last slide
  417.         il_SlideNumber = im_TOTAL_NUMBER_OF_SLIDES
  418.         ' disable the 'next' button
  419.         cmdSlide(1).Enabled = False
  420.         cmdSlide(0).SetFocus
  421.     Case Else ' we are in the middle so make sure that both buttons are enabled
  422.         ' enable the 'back' button
  423.         cmdSlide(0).Enabled = True
  424.         ' enable the 'next' button
  425.         cmdSlide(1).Enabled = True
  426.     End Select
  427.     ' show the slide to the user
  428.     Call ShowSlide(il_SlideNumber)
  429. End Sub
  430. Private Sub FillComboBox(MultipleColumns As Integer)
  431.     Screen.MousePointer = vbHourglass
  432.     Dim iCount As Integer, iRandomCharacter As Integer
  433.     Dim sRandomTextOne As String, sRandomTextTwo As String
  434.     Mh3dComboDemo.Clear ' clear combo box
  435.     ' for faster filling turn the .ScreenUpdate property off while loading items
  436.     Mh3dComboDemo.Screenupdate = False
  437.     Randomize (Timer) ' this is make sure that each time this procedure is run we
  438.                         '   get different sets of text
  439.     ' generate the strings of random characters
  440.     Select Case MultipleColumns
  441.     Case True
  442.         For iCount = 0 To 50
  443.             sRandomTextOne = ""
  444.             sRandomTextTwo = ""
  445.             For iRandomCharacter = 1 To 8
  446.                 ' add a random ucase letter to sRandomTextOne and sRandomTextTwo
  447.                 sRandomTextOne = sRandomTextOne & Chr$((Rnd * 25) + 65)
  448.                 sRandomTextTwo = sRandomTextTwo & Chr$((Rnd * 25) + 65)
  449.             Next iRandomCharacter
  450.             ' add text variables to combo box as two columns
  451.             Mh3dComboDemo.AddItem sRandomTextOne & Chr$(9) & sRandomTextTwo, iCount
  452.         Next iCount
  453.         ' show both columns
  454.         Mh3dComboDemo.Col = 1
  455.         Mh3dComboDemo.ColWidth = 15
  456.     Case False
  457.         For iCount = 0 To 50
  458.             sRandomTextOne = ""
  459.             For iRandomCharacter = 1 To 8
  460.                 ' add a random ucase letter to sRandomTextOne
  461.                 sRandomTextOne = sRandomTextOne & Chr$((Rnd * 25) + 65)
  462.             Next iRandomCharacter
  463.             ' add text variable to combo box
  464.             Mh3dComboDemo.AddItem sRandomTextOne, iCount
  465.         Next iCount
  466.         ' hide the 2nd column
  467.         Mh3dComboDemo.Col = 1
  468.         Mh3dComboDemo.ColWidth = 0
  469.     End Select
  470.     ' turn screen update back on
  471.     Mh3dComboDemo.Screenupdate = True
  472.     Screen.MousePointer = vbDefault
  473. End Sub
  474. Private Sub Form_Load()
  475.     Screen.MousePointer = vbHourglass
  476.     Dim iDisplaySlideLeft As Integer, iDisplaySlideTop As Integer
  477.     ' using the location of the first Frame...
  478.     iDisplaySlideTop = fraTheLook.Top
  479.     iDisplaySlideLeft = fraTheLook.Left
  480.     ' ...place all display frames in the same location
  481.     Dim iCount As Integer, TempControl As Control
  482.     For iCount = 0 To Me.Controls.Count - 1
  483.         Set TempControl = Me.Controls(iCount)
  484.         If TypeOf TempControl Is Frame Then
  485.             If TempControl.Tag = "slide frame" Then
  486.                 TempControl.Left = iDisplaySlideLeft
  487.                 TempControl.Top = iDisplaySlideTop
  488.             End If
  489.         End If
  490.     Next iCount
  491.     ' center the form to the screen
  492.     Call CenterForm(Me)
  493.     ' change text boxes back to back color of white
  494.     For Each TempControl In Me.Controls
  495.         If TypeOf TempControl Is TextBox Then
  496.             TempControl.BackColor = vbWhite
  497.         End If
  498.     Next TempControl
  499.     ' setup combo
  500.     Mh3dComboDemo.ColScale = mhColSmAvgChar
  501.     Mh3dComboDemo.Col = 0
  502.     Mh3dComboDemo.ColWidth = 15
  503.     Mh3dComboDemo.Col = 1
  504.     Mh3dComboDemo.ColWidth = 15
  505.     ' load the combo box with one column of items
  506.     Call FillComboBox(False)
  507.     ' select the first item
  508.     Mh3dComboDemo.ListIndex = 0
  509.     Mh3dComboDemo.DividerStyle = mhDividerStyleLowered
  510.     ' greet the user warmly!
  511.     Dim sGreeting As String
  512.     Randomize (Timer)
  513.     Select Case Int(Rnd * 4)
  514.     Case 0
  515.         sGreeting = "Howdi programmer..."
  516.     Case 1
  517.         sGreeting = "Hi there..."
  518.     Case 2
  519.         sGreeting = "It's Mh3dCombo Time!"
  520.     Case Else
  521.         sGreeting = "Welcome to the MicroHelp Mh3dCombo Demo!"
  522.     End Select
  523.     Call SetStatusLineText(sGreeting, True, iTimePeriod:=3001)
  524.     Screen.MousePointer = vbDefault
  525. End Sub
  526. Private Sub Form_Unload(Cancel As Integer)
  527.     Me.Hide
  528.     ' show message about ever other time
  529.     Randomize (Timer)
  530.     If Int(Rnd * 10) >= 5 Then MsgBox "This control has many features in common with the Mh3dList control.  For a further look into some of these features please see the more extensive Mh3dList demo program."
  531.     ' close this demo correctly
  532.     End
  533. End Sub
  534. Private Sub Mh3dComboDemo_Click()
  535.     Dim sMessage As String
  536.     ' tell user which item has been selected
  537.     sMessage = "Item '" & Mh3dComboDemo.List(Mh3dComboDemo.ListIndex) & "' at index" & Str$(Mh3dComboDemo.ListIndex) & " has been selected."
  538.     Call SetStatusLineText(sMessage, bOverRide:=False, iTimePeriod:=2001)
  539. End Sub
  540. Private Sub Mh3dComboDemo_CloseUp()
  541.     ' tell user that this event has been fired
  542.     Call SetStatusLineText("The Combo box's CloseUp event has been fired.", False, 2001)
  543. End Sub
  544. Private Sub mnuAbout_Click()
  545.     ' show about box
  546.     Call ShowAbout
  547. End Sub
  548. Private Sub mnuFileExit_Click()
  549.     ' close down demo
  550.     Unload Me
  551. End Sub
  552. Private Sub optDividerStyle_Click(Index As Integer)
  553.     Select Case Index
  554.     Case 0 ' user chose lowered style
  555.         Mh3dComboDemo.DividerStyle = mhDividerStyleLowered
  556.         If chkMultipleColumns.Value = 1 Then chkColumnDivider.Enabled = True
  557.     Case 1 ' user chose raised style
  558.         Mh3dComboDemo.DividerStyle = mhDividerStyleRaised
  559.         If chkMultipleColumns.Value = 1 Then chkColumnDivider.Enabled = True
  560.     Case 2 ' none
  561.         Mh3dComboDemo.DividerStyle = mhDividerStyleNone
  562.         ' do not allow the user to change the column divider settings since there
  563.         '   is no column divider when .DividerStyle is set to 0
  564.         chkColumnDivider.Enabled = False
  565.     End Select
  566. End Sub
  567. ' This generic routine can be used to search in both the Mh3DList control and the
  568. '   Mh3DCombo box.
  569. ' *note: If a control which is not a Mh3DList or Mh3DCombo box is passed to this
  570. '       routine the error 422: "Property "propertyname" not found." may be generated.
  571. Private Function SearchMhListTypeControl(xListControl As Control, SearchText As String, FindFirstOccurance As Integer, StringSearchOption As Integer) As Long
  572.     ' search the list/combo box for the text in the text box and return the result
  573.     ' if we are starting the search from the beginning of list then reset the .FoundIndex
  574.     If FindFirstOccurance Then xListControl.FoundIndex = -1
  575.     ' determine the type of search the the user wants
  576.     Select Case StringSearchOption
  577.     Case False
  578.         ' do a string search
  579.         xListControl.FindString = SearchText
  580.     Case True
  581.         ' do an in-string search
  582.         xListControl.FindInstr = SearchText
  583.     End Select
  584.     ' return the index at which the item was found (will be -1 if not found)
  585.     SearchMhListTypeControl = xListControl.FoundIndex
  586. End Function
  587. ' This procedure sets the status line text to the text in sNewText parameter
  588. '   and keeps the text there for the time period specified in milliseconds by the
  589. '   iTimePeriod parameter.  This procedure has a single item queue so that one
  590. '   message can be saved to be shown after the current message has been displayed.
  591. '   The display of the current message can also be over-ridden by setting the bOverRide
  592. '   parameter to True.
  593. Private Sub SetStatusLineText(sNewText As String, bOverRide As Boolean, iTimePeriod As Integer)
  594.     Static sQueueText As String, iQueueiTimePeriod As Integer, bQueueIsEmpty As Boolean
  595.     With tmrStatusLine
  596.         ' if this procedure was called by the timer then reset the text and turn timer off
  597.         If sNewText = "_timer_calling_" Then
  598.             ' turn timer off
  599.             .Enabled = False
  600.             ' if there is something in the queue then display it
  601.             If Not bQueueIsEmpty Then
  602.                 panStatusLine.Caption = sQueueText
  603.                 ' setup timer to call this procedure when the iTimePeriod has expired
  604.                 .Interval = iQueueiTimePeriod
  605.                 sQueueText = "" ' clear text in queue
  606.                 bQueueIsEmpty = True
  607.                 iQueueiTimePeriod = 0
  608.                 .Enabled = True
  609.             Else
  610.                 ' reset status line text
  611.                 panStatusLine.Caption = "Ready..."
  612.             End If
  613.         Else
  614.             ' The procedure was not called by the timer.  So, if the timer is enabled then
  615.             '   there is already a message being displayed so place this message in the single
  616.             '   item queue.  But, if this is being over-ridden then show the message now
  617.             If tmrStatusLine.Enabled And Not bOverRide Then
  618.                 sQueueText = sNewText ' place text in queue
  619.                 iQueueiTimePeriod = iTimePeriod ' place message display time period in queue
  620.                 bQueueIsEmpty = False
  621.             Else ' otherwise show the message now
  622.                 .Enabled = False
  623.                 sQueueText = ""
  624.                 iQueueiTimePeriod = 0
  625.                 bQueueIsEmpty = True
  626.                 panStatusLine.Caption = sNewText
  627.                 ' setup timer to call this procedure when the iTimePeriod has expired
  628.                 .Interval = iTimePeriod
  629.                 .Enabled = True
  630.             End If
  631.         End If
  632.     End With ' tmrStatusLine
  633. End Sub
  634. ' This procedure sets up the different views according to the iSlideNumber parameter
  635. Private Sub ShowSlide(iSlideNumber As Integer)
  636.     Dim oCurrentSlide As Frame
  637.     ' most slides use this control so show it by default
  638.     Mh3dComboDemo.Visible = True
  639.     ' only one slide uses this text box so clear its text by default
  640.     txtTipsAndTricks.Text = ""
  641.     ' select the desired slide oCurrentSlide
  642.     Select Case iSlideNumber
  643.     Case 1
  644.         Set oCurrentSlide = fraTheLook
  645.         oCurrentSlide.Visible = True
  646.     Case 2
  647.         Set oCurrentSlide = fraSearching
  648.         oCurrentSlide.Visible = True
  649.         txtSearch.SetFocus
  650.     Case 3
  651.         ' setup the tip information
  652.         Set oCurrentSlide = fraTipsAndTricks
  653.         oCurrentSlide.Visible = True
  654.         With txtTipsAndTricks
  655.             .SetFocus
  656.             .Text = "Display Single Column In Edit Portion" & vbCrLf & "If the control is not bound to a data control you can select the column from which the edit portion gets its text (as opposed to displaying the entire list item along with the column seperator character).  To do this simply set the .Col property to the desired column and set the .ColDataField and .ColDataFieldList properties to the same arbitrary string."
  657.             .Text = .Text & vbCrLf & vbCrLf & "Using The Virtual List Feature" & vbCrLf & "When the Mh3dCombo is bound to a Data control and it's .VirtualList property is set to True you can no longer use the .List property to get items from the control.  You can, however, set .ListIndex to the item that you want then use the .Text or .ColText properties to get the text." & vbCrLf & vbCrLf & "Speeding Up Operations" & vbCrLf & "When manipulating the properties of the control many times in a row (like adding items) you should use the .ScreenUpdate property to turn screen updating off so that the operation goes much faster.  See the code used to build this demo."
  658.         End With ' txtTipsAndTricks
  659.         Mh3dComboDemo.Visible = False
  660.         cmdSlide(0).SetFocus
  661.     End Select
  662.     ' make all frames but the current one invisible
  663.     Dim iCount As Integer, TempControl As Control
  664.     For iCount = 0 To Me.Controls.Count - 1
  665.         Set TempControl = Me.Controls(iCount)
  666.         If TypeOf TempControl Is Frame Then
  667.             With TempControl
  668.             If .Tag = "slide frame" And oCurrentSlide.hWnd <> .hWnd Then .Visible = False
  669.             End With ' TempControl
  670.         End If
  671.     Next iCount
  672. End Sub
  673. Private Sub tmrStatusLine_Timer()
  674.     ' tell status line that it is time to reset itself
  675.     Call SetStatusLineText("_timer_calling_", False, 0)
  676. End Sub
  677. Private Sub txtSearch_Change()
  678.     ' enable/disable search buttons according to the availability of text to search with
  679.     If Len(txtSearch.Text) > 0 Then
  680.         cmdSearch(0).Enabled = True
  681.         cmdSearch(1).Enabled = True
  682.     Else
  683.         cmdSearch(0).Enabled = False
  684.         cmdSearch(1).Enabled = False
  685.     End If
  686. End Sub
  687. Private Sub txtSearch_KeyPress(KeyAscii As Integer)
  688.     ' make all lower case letters upper case to match items in combo box.  This is
  689.     '   just for visual appeal because the .FindString and .FindInstr searches are
  690.     '   case-insensitive.
  691.     If KeyAscii > 95 And KeyAscii < 123 Then KeyAscii = KeyAscii - 32
  692.                                         
  693. End Sub
  694. Public Sub CenterForm(x_YourForm As Form)
  695.     ' center the form to screen
  696.     With x_YourForm
  697.         .Move Abs(Screen.Width - .Width) \ 2, Abs(Screen.Height - .Height) \ 2
  698.     End With ' x_YourForm
  699. End Sub
  700. Public Sub ShowAbout()
  701.     ' show the about box
  702.     Screen.MousePointer = vbHourglass
  703.     ' make this form the parent so that the frmAbout can access its methods
  704.     Set frmAbout.ParentForm = Me
  705.     frmAbout.Show
  706.     Screen.MousePointer = vbDefault
  707. End Sub
  708.