I would recommend using the Message Dialog Class for Warning messages.
As a mater of fact I use it all the time in a module I created called
AlertMessage. This module contains a method that I use for all Alerts.
AlertMsg(MsgTitle As String,Msg As String,Expl As String,MsgIcn As
String,ActnBtn As String,CnclBtn As Boolean,AltBtn As Boolean,AltCptn As
String)
Dim dlg as New MessageDialog // Declare the MessageDialog object
Dim btn as MessageDialogButton // For handling the result
If MsgIcn = "None" Then
dlg.Icon = -1 //display no icon
ElseIf MsgIcn = "Note" Then
dlg.Icon = 0 //display the Note icon
ElseIf MsgIcn = "Caution" Then
dlg.Icon = 1 //display Caution/Warning Triange icon
ElseIf MsgIcn = "Stop" Then
dlg.Icon = 2 //display Caution/Warning icon
ElseIf MsgIcn = "Question" Then
dlg.Icon = 3 //display Caution/Warning icon
End If
dlg.Title = MsgTitle
dlg.ActionButton.Caption = ActnBtn
dlg.CancelButton.Visible = CnclBtn //show the Cancel button
If AltBtn = True Then
dlg.AlternateActionButton.Visible = AltBtn //show the Alternate
Action button
dlg.AlternateActionButton.Caption = AltCptn
End If
dlg.Message = Msg
dlg.Explanation = Expl
Beep
btn =dlg.ShowModal //display the dialog
Select Case btn //determine which button was pressed.
Case dlg.ActionButton //user pressed the Action button
MsgBtn = 1
Case dlg.CancelButton //user pressed the Cancel button
MsgBtn = 2
Case dlg.AlternateActionButton //user pressed Alternate Action button
MsgBtn = 3
End select
//////////////////
Usage:
Copy and paste a code selection below and replace the items in quotes. I
keep this section in a note inside the module.
//////////////////
//----------------------------------------------------------------------
------------
//Alert Message with 3 buttons with Action, Cancel and Alternate
Action buttons
AlertMsg("Title","Message
","Explanation",3,"Note","Action",True,True,"AltAction")
If MsgBtn = 1 Then
//User Pressed Action Button
ElseIf MsgBtn = 2 Then
//User Pressed Cancel Button
ElseIf MsgBtn = 3 Then
//User Pressed Alternate Action Button
End If
//----------------------------------------------------------------------
------------
//Alert Message with 2 buttons with Action and Cancel buttons
AlertMsg("Title","Message
","Explanation","Note","Action",True,False,"")
If MsgBtn = 1 Then
//User Pressed Action Button
ElseIf MsgBtn = 2 Then
//User Pressed Cancel Button
End If
//----------------------------------------------------------------------
------------
//Alert Message with 2 buttons with Action and Alternate Action
buttons
AlertMsg("Title","Message
","Explanation","Note","Action",False,True,"AltAction")
If MsgBtn = 1 Then
//User Pressed Action Button
ElseIf MsgBtn = 3 Then
//User Pressed Alternate Action Button
End If
//----------------------------------------------------------------------
------------
//Alert Message with 1 Action button
AlertMsg("Title","Message
","Explanation","Note","Action",False,False,"")
If MsgBtn = 1 Then
//User Pressed Action Button
End If
//----------------------------------------------------------------------
------------
//////////////////
Example:
// Database Error Alert Message with OK button
AlertMsg("Error","Database Error
",DB.ErrorMessage,"Stop","OK",False,False,"")
HTH
Tom
> How does one access the various warning icons for dialogs using RB?
>
> Is there a standard set I can lay my hands on somewhere?
>
> Regards,
>
> Chuck
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>