home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
207.233.110.77
/
207.233.110.77.tar
/
207.233.110.77
/
BackupWebs
/
gcampbell
/
graphics
/
msgboxwiz.exe
/
frmMsgBoxWiz.frm
next >
Wrap
Text File
|
1997-08-05
|
33KB
|
902 lines
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.1#0"; "COMCTL32.OCX"
Begin VB.Form frmMsgBoxWiz
Caption = "MsgBox Wizard"
ClientHeight = 5055
ClientLeft = 2310
ClientTop = 1455
ClientWidth = 4095
Icon = "frmMsgBoxWiz.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
PaletteMode = 1 'UseZOrder
ScaleHeight = 5055
ScaleWidth = 4095
StartUpPosition = 2 'CenterScreen
Begin ComctlLib.Toolbar tbIcons
Height = 630
Left = 1080
TabIndex = 18
Top = 1410
Width = 2970
_ExtentX = 5239
_ExtentY = 1111
ButtonWidth = 1032
ButtonHeight = 1005
Wrappable = 0 'False
Appearance = 1
ImageList = "iListIcons"
_Version = 327680
BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
NumButtons = 5
BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "None"
Object.ToolTipText = "No Icon"
Object.Tag = ""
ImageIndex = 1
EndProperty
BeginProperty Button2 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "Critical"
Object.ToolTipText = "Insert Critical Icon"
Object.Tag = ""
ImageIndex = 2
EndProperty
BeginProperty Button3 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "QMark"
Object.ToolTipText = "Insert Question Icon"
Object.Tag = ""
ImageIndex = 3
EndProperty
BeginProperty Button4 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "EMark"
Object.ToolTipText = "Insert Exclamation Icon"
Object.Tag = ""
ImageIndex = 4
EndProperty
BeginProperty Button5 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "Info"
Object.ToolTipText = "Insert Info Icon"
Object.Tag = ""
ImageIndex = 5
EndProperty
EndProperty
MouseIcon = "frmMsgBoxWiz.frx":0442
End
Begin VB.CommandButton cmdClose
Caption = "Close"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 465
Left = 2445
TabIndex = 17
Top = 4545
Width = 1605
End
Begin VB.CommandButton cmdSave
Caption = "Save to Clipboard"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 465
Left = 75
TabIndex = 16
Top = 4545
Width = 2295
End
Begin VB.CommandButton cmdTest
Caption = "Test"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1380
Left = 75
TabIndex = 15
Top = 3105
Width = 810
End
Begin VB.Frame Frame1
Caption = "Modality"
Height = 885
Index = 2
Left = 60
TabIndex = 12
Top = 2100
Width = 825
Begin VB.OptionButton optMod
Caption = "Sys"
Height = 225
Index = 1
Left = 90
TabIndex = 14
Top = 555
Width = 615
End
Begin VB.OptionButton optMod
Caption = "App"
Height = 225
Index = 0
Left = 90
TabIndex = 13
Top = 285
Value = -1 'True
Width = 615
End
End
Begin VB.Frame Frame1
Caption = "Select button set, click default button"
Height = 2400
Index = 1
Left = 990
TabIndex = 5
Top = 2100
Width = 3060
Begin ComctlLib.Toolbar tbButton
Height = 375
Index = 11
Left = 2100
TabIndex = 30
Top = 1605
Width = 870
_ExtentX = 1535
_ExtentY = 661
ButtonWidth = 1508
ButtonHeight = 556
Wrappable = 0 'False
ImageList = "iListButtons"
_Version = 327680
BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
NumButtons = 1
BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "Cancel3"
Object.Tag = ""
ImageIndex = 2
EndProperty
EndProperty
MouseIcon = "frmMsgBoxWiz.frx":045E
End
Begin ComctlLib.Toolbar tbButton
Height = 375
Index = 10
Left = 1245
TabIndex = 29
Top = 1950
Width = 885
_ExtentX = 1561
_ExtentY = 661
ButtonWidth = 1508
ButtonHeight = 556
Wrappable = 0 'False
ImageList = "iListButtons"
_Version = 327680
BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
NumButtons = 1
BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "Retry2"
Object.Tag = ""
ImageIndex = 5
EndProperty
EndProperty
MouseIcon = "frmMsgBoxWiz.frx":047A
End
Begin ComctlLib.Toolbar tbButton
Height = 375
Index = 9
Left = 1245
TabIndex = 28
Top = 1605
Width = 870
_ExtentX = 1535
_ExtentY = 661
ButtonWidth = 1508
ButtonHeight = 556
Wrappable = 0 'False
ImageList = "iListButtons"
_Version = 327680
BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
NumButtons = 1
BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "No2"
Object.Tag = ""
ImageIndex = 4
EndProperty
EndProperty
MouseIcon = "frmMsgBoxWiz.frx":0496
End
Begin ComctlLib.Toolbar tbButton
Height = 375
Index = 8
Left = 1245
TabIndex = 27
Top = 1260
Width = 870
_ExtentX = 1535
_ExtentY = 661
ButtonWidth = 1508
ButtonHeight = 556
Wrappable = 0 'False
ImageList = "iListButtons"
_Version = 327680
BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
NumButtons = 1
BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "Cancel2"
Object.Tag = ""
ImageIndex = 2
EndProperty
EndProperty
MouseIcon = "frmMsgBoxWiz.frx":04B2
End
Begin ComctlLib.Toolbar tbButton
Height = 375
Index = 7
Left = 1245
TabIndex = 26
Top = 915
Width = 870
_ExtentX = 1535
_ExtentY = 661
ButtonWidth = 1508
ButtonHeight = 556
Wrappable = 0 'False
ImageList = "iListButtons"
_Version = 327680
BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
NumButtons = 1
BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "No1"
Object.Tag = ""
ImageIndex = 4
EndProperty
EndProperty
MouseIcon = "frmMsgBoxWiz.frx":04CE
End
Begin ComctlLib.Toolbar tbButton
Height = 375
Index = 6
Left = 1245
TabIndex = 25
Top = 570
Width = 870
_ExtentX = 1535
_ExtentY = 661
ButtonWidth = 1508
ButtonHeight = 556
Wrappable = 0 'False
ImageList = "iListButtons"
_Version = 327680
BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
NumButtons = 1
BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "Cancel1"
Object.Tag = ""
ImageIndex = 2
EndProperty
EndProperty
MouseIcon = "frmMsgBoxWiz.frx":04EA
End
Begin ComctlLib.Toolbar tbButton
Height = 375
Index = 4
Left = 390
TabIndex = 23
Top = 1605
Width = 855
_ExtentX = 1508
_ExtentY = 661
ButtonWidth = 1508
ButtonHeight = 556
Wrappable = 0 'False
ImageList = "iListButtons"
_Version = 327680
BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
NumButtons = 1
BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "Yes2"
Object.Tag = ""
ImageIndex = 3
EndProperty
EndProperty
MouseIcon = "frmMsgBoxWiz.frx":0506
End
Begin ComctlLib.Toolbar tbButton
Height = 375
Index = 3
Left = 390
TabIndex = 22
Top = 1260
Width = 885
_ExtentX = 1561
_ExtentY = 661
ButtonWidth = 1508
ButtonHeight = 556
Wrappable = 0 'False
ImageList = "iListButtons"
_Version = 327680
BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
NumButtons = 1
BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "Retry1"
Object.Tag = ""
ImageIndex = 5
EndProperty
EndProperty
MouseIcon = "frmMsgBoxWiz.frx":0522
End
Begin ComctlLib.Toolbar tbButton
Height = 375
Index = 2
Left = 390
TabIndex = 21
Top = 915
Width = 885
_ExtentX = 1561
_ExtentY = 661
ButtonWidth = 1508
ButtonHeight = 556
Wrappable = 0 'False
ImageList = "iListButtons"
_Version = 327680
BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
NumButtons = 1
BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "Yes1"
Object.Tag = ""
ImageIndex = 3
EndProperty
EndProperty
MouseIcon = "frmMsgBoxWiz.frx":053E
End
Begin ComctlLib.Toolbar tbButton
Height = 375
Index = 12
Left = 2100
TabIndex = 31
Top = 1950
Width = 870
_ExtentX = 1535
_ExtentY = 661
ButtonWidth = 1508
ButtonHeight = 556
Wrappable = 0 'False
ImageList = "iListButtons"
_Version = 327680
BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
NumButtons = 1
BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "Ignore"
Object.Tag = ""
ImageIndex = 7
EndProperty
EndProperty
MouseIcon = "frmMsgBoxWiz.frx":055A
End
Begin ComctlLib.Toolbar tbButton
Height = 375
Index = 5
Left = 390
TabIndex = 24
Top = 1950
Width = 870
_ExtentX = 1535
_ExtentY = 661
ButtonWidth = 1508
ButtonHeight = 556
Wrappable = 0 'False
ImageList = "iListButtons"
_Version = 327680
BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
NumButtons = 1
BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "Abort"
Object.Tag = ""
ImageIndex = 6
EndProperty
EndProperty
MouseIcon = "frmMsgBoxWiz.frx":0576
End
Begin ComctlLib.Toolbar tbButton
Height = 375
Index = 1
Left = 390
TabIndex = 20
Top = 570
Width = 870
_ExtentX = 1535
_ExtentY = 661
ButtonWidth = 1508
ButtonHeight = 556
Wrappable = 0 'False
ImageList = "iListButtons"
_Version = 327680
BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
NumButtons = 1
BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "Okay"
Object.Tag = ""
ImageIndex = 1
EndProperty
EndProperty
MouseIcon = "frmMsgBoxWiz.frx":0592
End
Begin ComctlLib.Toolbar tbButton
Height = 375
Index = 0
Left = 390
TabIndex = 19
Top = 225
Width = 885
_ExtentX = 1561
_ExtentY = 661
ButtonWidth = 1508
ButtonHeight = 556
ImageList = "iListButtons"
_Version = 327680
BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
NumButtons = 1
BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "Okay"
Object.Tag = ""
ImageIndex = 1
EndProperty
EndProperty
MouseIcon = "frmMsgBoxWiz.frx":05AE
End
Begin VB.OptionButton optButGrp
Height = 285
Index = 5
Left = 135
TabIndex = 11
Top = 1995
Width = 210
End
Begin VB.OptionButton optButGrp
Height = 285
Index = 4
Left = 135
TabIndex = 10
Top = 1653
Width = 210
End
Begin VB.OptionButton optButGrp
Height = 285
Index = 3
Left = 135
TabIndex = 9
Top = 1311
Width = 210
End
Begin VB.OptionButton optButGrp
Height = 285
Index = 2
Left = 135
TabIndex = 8
Top = 969
Width = 210
End
Begin VB.OptionButton optButGrp
Height = 285
Index = 1
Left = 135
TabIndex = 7
Top = 627
Width = 210
End
Begin VB.OptionButton optButGrp
Height = 285
Index = 0
Left = 135
TabIndex = 6
Top = 285
Value = -1 'True
Width = 210
End
End
Begin VB.TextBox txtMessage
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 840
Left = 975
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 2
Top = 510
Width = 3075
End
Begin VB.TextBox txtTitle
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 975
TabIndex = 0
Top = 90
Width = 3075
End
Begin ComctlLib.ImageList iListButtons
Left = 3375
Top = 2655
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 50
ImageHeight = 14
MaskColor = 12632256
_Version = 327680
BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7}
NumListImages = 7
BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmMsgBoxWiz.frx":05CA
Key = ""
EndProperty
BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmMsgBoxWiz.frx":07E4
Key = ""
EndProperty
BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmMsgBoxWiz.frx":09FE
Key = ""
EndProperty
BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmMsgBoxWiz.frx":0C18
Key = ""
EndProperty
BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmMsgBoxWiz.frx":0E32
Key = ""
EndProperty
BeginProperty ListImage6 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmMsgBoxWiz.frx":104C
Key = ""
EndProperty
BeginProperty ListImage7 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmMsgBoxWiz.frx":1266
Key = ""
EndProperty
EndProperty
End
Begin ComctlLib.ImageList iListIcons
Left = 3375
Top = 2970
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 327680
BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7}
NumListImages = 5
BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmMsgBoxWiz.frx":1480
Key = ""
EndProperty
BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmMsgBoxWiz.frx":1712
Key = ""
EndProperty
BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmMsgBoxWiz.frx":2364
Key = ""
EndProperty
BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmMsgBoxWiz.frx":2FB6
Key = ""
EndProperty
BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmMsgBoxWiz.frx":3C08
Key = ""
EndProperty
EndProperty
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
Caption = "Select Icon:"
Height = 555
Index = 2
Left = 225
TabIndex = 4
Top = 1440
Width = 720
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
Caption = "Message: Press Enter to end a line."
Height = 810
Index = 1
Left = 15
TabIndex = 3
Top = 510
Width = 930
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
Caption = "Title:"
Height = 270
Index = 0
Left = 420
TabIndex = 1
Top = 150
Width = 510
End
End
Attribute VB_Name = "frmMsgBoxWiz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim sIcon As String 'Icon
Dim iIcon As Integer 'Numeric value of Icon for testing
Dim sModality As String 'Modality setting
Dim iModality As Integer 'Numeric value of Modality for testing
Dim sButtonGroup As String 'Button Group
Dim iButtonGroup As Integer 'Numeric value of ButtonGroup for testing
Dim sDefaultButton As String 'Default Button
Dim iDefaultButton As Integer 'Numeric value of Default Button for testing
Dim QUOTEMARK As String 'Quotation mark constant
Dim bSkipFlag As Boolean 'Changing the Value property of an Option
' Button or Ribbon Button automatically
' calls its Click event procedure. Use
' this flag to control when the code in
' the Click event procedure is executed.
'
'Exit and Unload the application
'
Private Sub cmdClose_Click()
Unload Me
End Sub
'
'Saves the Message Box info to the Clipboard for pasting into
' a Visual Basic Code Window
'
Private Sub cmdSave_Click()
Dim sTemp As String, sStore As String
'For a single OK button there is no Return Code
If sButtonGroup = "vbOK" Then
sTemp = "Dim sMsgText As String" & vbCrLf & _
"sMsgText = " & ParseMessage(txtMessage.Text) & vbCrLf & _
"MsgBox sMsgText, " & sDefaultButton & " + " & _
sButtonGroup & " + " & sIcon & " + " & sModality & ", " _
& QUOTEMARK & txtTitle.Text & QUOTEMARK
Else
sTemp = "Dim iReturnCode As Integer" & vbCrLf & _
"Dim sMsgText As String" & vbCrLf & _
"sMsgText = " & ParseMessage(txtMessage.Text) & vbCrLf & _
"iReturnCode = MsgBox(sMsgText, " & sDefaultButton & " + " _
& sButtonGroup & " + " & sIcon & " + " & sModality & ", " _
& QUOTEMARK & txtTitle.Text & QUOTEMARK & ")" & vbCrLf & _
"'Enter code for the results" & vbCrLf & _
"Select Case iReturnCode" & vbCrLf
End If
Select Case sButtonGroup
Case "vbOKCancel"
sTemp = sTemp & " Case vbOK" & vbCrLf & vbCrLf & _
" Case vbCancel" & vbCrLf & vbCrLf & _
"End Select"
Case "vbYesNo"
sTemp = sTemp & " Case vbYes" & vbCrLf & vbCrLf & _
" Case vbNo" & vbCrLf & vbCrLf & _
"End Select"
Case "vbRetryCancel"
sTemp = sTemp & " Case vbRetry" & vbCrLf & vbCrLf & _
" Case vbCancel" & vbCrLf & vbCrLf & _
"End Select"
Case "vbYesNoCancel"
sTemp = sTemp & " Case vbYes" & vbCrLf & vbCrLf & _
" Case vbNo" & vbCrLf & vbCrLf & _
" Case vbCancel" & vbCrLf & vbCrLf & _
"End Select"
Case "vbAbortRetryIgnore"
sTemp = sTemp & " Case vbAbort" & vbCrLf & vbCrLf & _
" Case vbRetry" & vbCrLf & vbCrLf & _
" Case vbIgnore" & vbCrLf & vbCrLf & _
"End Select"
End Select
'Save the Text from the txtMessage Textbox. You need to use the
' Text property of a Textbox to copy text to the clipboard.
sStore = txtMessage.Text
'Copy the sTemp string to the txtMessage Textbox
txtMessage.Text = sTemp
'Copy the contents of the txtMessage textbox to the Clipboard
Clipboard.Clear
Clipboard.SetText txtMessage.Text
'Put the original Message text back into txtMessage
txtMessage.Text = sStore
MsgBox "Position the insertion point in your Code Window" & vbCrLf & _
"where you want the MsgBox code and Paste.", , _
"Ready to Paste the MsgBox Code"
'Call the cmdClose Click event procedure so that the program exits
cmdClose_Click
End Sub
'
'Shows how the Message Box will look
'
Private Sub cmdTest_Click()
MsgBox txtMessage.Text, iDefaultButton + iButtonGroup + iIcon + _
iModality, txtTitle.Text
End Sub
'
'Set some initial Values and Center the form on the Screen
'
Private Sub Form_Load()
QUOTEMARK = Chr(34)
bSkipFlag = False
optMod(0).Value = True
sIcon = "0"
iIcon = 0
sModality = "vbApplicationModal"
iModality = vbApplicationModal
sButtonGroup = "vbOKOnly"
iButtonGroup = vbOKOnly
sDefaultButton = "vbDefaultButton1"
iDefaultButton = vbDefaultButton1
End Sub
'
'Sets the selected Button Group
'
Private Sub optButGrp_Click(Index As Integer)
Dim i As Integer
Select Case Index
Case 0
sButtonGroup = "vbOKOnly"
iButtonGroup = vbOKOnly
Case 1
sButtonGroup = "vbOKCancel"
iButtonGroup = vbOKCancel
Case 2
sButtonGroup = "vbYesNo"
iButtonGroup = vbYesNo
Case 3
sButtonGroup = "vbRetryCancel"
iButtonGroup = vbRetryCancel
Case 4
sButtonGroup = "vbYesNoCancel"
iButtonGroup = vbYesNoCancel
Case 5
sButtonGroup = "vbAbortRetryIgnore"
iButtonGroup = vbAbortRetryIgnore
End Select
If bSkipFlag Then Exit Sub
'Deselect all the Default buttons, without executing the code in
' the tbButtons_Click event procedure
bSkipFlag = True
For i = 0 To 12
tbButton(i).Buttons(1).Value = tbrUnpressed
Next i
bSkipFlag = False
End Sub
'
'Sets the Message Box's Modal option to Application or System
'
Private Sub optMod_Click(Index As Integer)
Select Case Index
Case 0
sModality = "vbApplicationModal"
iModality = vbApplicationModal
Case Else
sModality = "vbSystemModal"
iModality = vbSystemModal
End Select
End Sub
'
'Adjucts the Message Text so that it will display properly
'
Public Function ParseMessage(sMessage As String) As String
Dim sTemp As String, sChar As String
Dim i As Integer
sTemp = QUOTEMARK
For i = 1 To Len(sMessage)
sChar = Mid(sMessage, i, 1)
If sChar <> vbCr And sChar <> vbLf Then
sTemp = sTemp & sChar
ElseIf sChar <> vbLf Then
sTemp = sTemp & QUOTEMARK & " & vbCrLf & " & QUOTEMARK
End If
Next i
sTemp = sTemp & QUOTEMARK
ParseMessage = sTemp
End Function
'
'Sets the default Button of the Button Group
'
Private Sub tbButton_ButtonClick(Index As Integer, ByVal Button As ComctlLib.Button)
Dim i As Integer, j As Integer
If bSkipFlag Then Exit Sub
Select Case Index
Case 0 To 5
sDefaultButton = "vbDefaultButton1"
iDefaultButton = vbDefaultButton1
Case 6 To 10
sDefaultButton = "vbDefaultButton2"
iDefaultButton = vbDefaultButton2
Case Else
sDefaultButton = "vbDefaultButton3"
iDefaultButton = vbDefaultButton3
End Select
bSkipFlag = True
For i = 0 To 12 'Unpress any pressed ones
tbButton(i).Buttons(1).Value = tbrUnpressed
Next i
Button.Value = tbrPressed 'Press the selected one
Select Case Index
Case 0
optButGrp(0).Value = True
Case 1, 6
optButGrp(1).Value = True
Case 2, 7
optButGrp(2).Value = True
Case 3, 8
optButGrp(3).Value = True
Case 4, 9, 11
optButGrp(4).Value = True
Case 5, 10, 12
optButGrp(5).Value = True
End Select
bSkipFlag = False
End Sub
'
'Sets the Icon to display in the Message Box
'
Private Sub tbIcons_ButtonClick(ByVal Button As ComctlLib.Button)
Dim i As Integer
For i = 1 To 5 'Unpress any pressed buttons
tbIcons.Buttons(i).Value = tbrUnpressed
Next i
Select Case Button.Key
Case Is = "None"
sIcon = "0"
iIcon = 0
tbIcons.Buttons(1).Value = tbrPressed
Case Is = "Critical"
sIcon = "vbCritical"
iIcon = vbCritical
tbIcons.Buttons(2).Value = tbrPressed
Case Is = "QMark"
sIcon = "vbQuestion"
iIcon = vbQuestion
tbIcons.Buttons(3).Value = tbrPressed
Case Is = "EMark"
sIcon = "vbExclamation"
iIcon = vbExclamation
tbIcons.Buttons(4).Value = tbrPressed
Case Is = "Info"
sIcon = "vbInformation"
iIcon = vbInformation
tbIcons.Buttons(5).Value = tbrPressed
End Select
End Sub