Hello
I wanted to share a simple method to save space in your project by adding a custom message dialog then having to rewrite the whole messagedialog Function for each time u want to use it your application!
Hope you enjoy
1. make a global method called MessageDialog in your APP class
Sub MessageDialog(Title As String, Message As String , Explanation As String , GraphicIcon As Integer , ActionCaption As String ="OK" , CancelCaption As String ="Cancel", CancelButton As Boolean)
'0 - GraphicNote (The application icon on Mac OS X)
'1 - GraphicCaution triangle (On Mac OS X, the application icon superimposed on the caution triangle)
'2 - GraphicStop (On Mac OS X 10.3 and above, the application icon)
'3 - GraphicQuestion icon (On Mac OS X 10.3 and above, it is the same as 0)
Dim d as New MessageDialog
Dim b as MessageDialogButton
d.icon= GraphicIcon
d.Title = Title
d.ActionButton.Caption = ActionCaption
d.CancelButton.Caption= CancelCaption
d.CancelButton.Visible = CancelButton
d.Message=Message
d.Explanation=Explanation
b=d.ShowModal
'You can use the return type as a boolean or a string to see what the user pressed
Select Case b
Case d.ActionButton
Speak "You Pressed OK"
Case d.CancelButton
Speak "You Pressed Cancel"
End Select
End Sub
2. Call it anywhere you like in your app
App.MessageDialog(App.ExecutableFile.Name,"Error: Testing Msg....","Msg Tested",1,"","", False)