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."
' close this demo correctly
End
End Sub
Private Sub Mh3dComboDemo_Click()
Dim sMessage As String
' tell user which item has been selected
sMessage = "Item '" & Mh3dComboDemo.List(Mh3dComboDemo.ListIndex) & "' at index" & Str$(Mh3dComboDemo.ListIndex) & " has been selected."
If chkMultipleColumns.Value = 1 Then chkColumnDivider.Enabled = True
Case 1 ' user chose raised style
Mh3dComboDemo.DividerStyle = mhDividerStyleRaised
If chkMultipleColumns.Value = 1 Then chkColumnDivider.Enabled = True
Case 2 ' none
Mh3dComboDemo.DividerStyle = mhDividerStyleNone
' do not allow the user to change the column divider settings since there
' is no column divider when .DividerStyle is set to 0
chkColumnDivider.Enabled = False
End Select
End Sub
' This generic routine can be used to search in both the Mh3DList control and the
' Mh3DCombo box.
' *note: If a control which is not a Mh3DList or Mh3DCombo box is passed to this
' routine the error 422: "Property "propertyname" not found." may be generated.
Private Function SearchMhListTypeControl(xListControl As Control, SearchText As String, FindFirstOccurance As Integer, StringSearchOption As Integer) As Long
' search the list/combo box for the text in the text box and return the result
' if we are starting the search from the beginning of list then reset the .FoundIndex
If FindFirstOccurance Then xListControl.FoundIndex = -1
' determine the type of search the the user wants
Select Case StringSearchOption
Case False
' do a string search
xListControl.FindString = SearchText
Case True
' do an in-string search
xListControl.FindInstr = SearchText
End Select
' return the index at which the item was found (will be -1 if not found)
SearchMhListTypeControl = xListControl.FoundIndex
End Function
' This procedure sets the status line text to the text in sNewText parameter
' and keeps the text there for the time period specified in milliseconds by the
' iTimePeriod parameter. This procedure has a single item queue so that one
' message can be saved to be shown after the current message has been displayed.
' The display of the current message can also be over-ridden by setting the bOverRide
' parameter to True.
Private Sub SetStatusLineText(sNewText As String, bOverRide As Boolean, iTimePeriod As Integer)
Static sQueueText As String, iQueueiTimePeriod As Integer, bQueueIsEmpty As Boolean
With tmrStatusLine
' if this procedure was called by the timer then reset the text and turn timer off
If sNewText = "_timer_calling_" Then
' turn timer off
.Enabled = False
' if there is something in the queue then display it
If Not bQueueIsEmpty Then
panStatusLine.Caption = sQueueText
' setup timer to call this procedure when the iTimePeriod has expired
.Interval = iQueueiTimePeriod
sQueueText = "" ' clear text in queue
bQueueIsEmpty = True
iQueueiTimePeriod = 0
.Enabled = True
Else
' reset status line text
panStatusLine.Caption = "Ready..."
End If
Else
' The procedure was not called by the timer. So, if the timer is enabled then
' there is already a message being displayed so place this message in the single
' item queue. But, if this is being over-ridden then show the message now
If tmrStatusLine.Enabled And Not bOverRide Then
sQueueText = sNewText ' place text in queue
iQueueiTimePeriod = iTimePeriod ' place message display time period in queue
bQueueIsEmpty = False
Else ' otherwise show the message now
.Enabled = False
sQueueText = ""
iQueueiTimePeriod = 0
bQueueIsEmpty = True
panStatusLine.Caption = sNewText
' setup timer to call this procedure when the iTimePeriod has expired
.Interval = iTimePeriod
.Enabled = True
End If
End If
End With ' tmrStatusLine
End Sub
' This procedure sets up the different views according to the iSlideNumber parameter
Private Sub ShowSlide(iSlideNumber As Integer)
Dim oCurrentSlide As Frame
' most slides use this control so show it by default
Mh3dComboDemo.Visible = True
' only one slide uses this text box so clear its text by default
txtTipsAndTricks.Text = ""
' select the desired slide oCurrentSlide
Select Case iSlideNumber
Case 1
Set oCurrentSlide = fraTheLook
oCurrentSlide.Visible = True
Case 2
Set oCurrentSlide = fraSearching
oCurrentSlide.Visible = True
txtSearch.SetFocus
Case 3
' setup the tip information
Set oCurrentSlide = fraTipsAndTricks
oCurrentSlide.Visible = True
With txtTipsAndTricks
.SetFocus
.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."
.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."
End With ' txtTipsAndTricks
Mh3dComboDemo.Visible = False
cmdSlide(0).SetFocus
End Select
' make all frames but the current one invisible
Dim iCount As Integer, TempControl As Control
For iCount = 0 To Me.Controls.Count - 1
Set TempControl = Me.Controls(iCount)
If TypeOf TempControl Is Frame Then
With TempControl
If .Tag = "slide frame" And oCurrentSlide.hWnd <> .hWnd Then .Visible = False
End With ' TempControl
End If
Next iCount
End Sub
Private Sub tmrStatusLine_Timer()
' tell status line that it is time to reset itself