put an URL/hyperlink in msgbox

just wonder if Xojo can put an URL into a msgbox or not. In VB.NET there is no way to put an url into messagebox unless you make your own msgbox.

I tried to search in this forum, but see few topics about msgbox. Anyone can help, thanks in advance.

No, you cannot. The MsgBox is very simple. Instead create your own dialog, using a Window for desktop apps or a WebDialog for web apps.

Bo,

You can use the MessageDialog class which is a more flexible version of the msgbox. This is an example of a more advanced message box like method I use with hyper links. HTH.

http://documentation.xojo.com/index.php/MessageDialog

#IF TargetWin32 Then
Dim SessionCompleteDialog as New MessageDialog
Dim SessionCompleteDialogButton as MessageDialogButton
SessionCompleteDialog.icon=MessageDialog.GraphicNote
SessionCompleteDialog.ActionButton.Caption=“Question?”
SessionCompleteDialog.CancelButton.Visible=False
SessionCompleteDialog.AlternateActionButton.Visible=True
SessionCompleteDialog.AlternateActionButton.Caption=“Purchase”
SessionCompleteDialog.Message=“Trial Session Time Limit Reached”+EndOfLine+EndOfLine+“Thank you for trying My Product”
SessionCompleteDialogButton=SessionCompleteDialog.ShowModal

Select Case SessionCompleteDialogButton
Case SessionCompleteDialog.ActionButton
  //user pressed "Contact Us"
  Dim EmailCMD as New Shell
  MsgBox "Please email us at:" + EndOfLine + EndOfLine +"blah@blah.com"
  
Case SessionCompleteDialog.AlternateActionButton
  Dim HTTPCMD as New Shell
  HTTPCMD.Execute("""C:\\Program Files\\Internet Explorer\\iexplore.exe"" http://www.blah.com")
End select

#ENDIF

[quote=79590:@Mike Cotrone]Bo,

You can use the MessageDialog class which is a more flexible version of the msgbox. This is an example of a more advanced message box like method I use with hyper links. HTH.

http://documentation.xojo.com/index.php/MessageDialog

#IF TargetWin32 Then
Dim SessionCompleteDialog as New MessageDialog
Dim SessionCompleteDialogButton as MessageDialogButton
SessionCompleteDialog.icon=MessageDialog.GraphicNote
SessionCompleteDialog.ActionButton.Caption=“Question?”
SessionCompleteDialog.CancelButton.Visible=False
SessionCompleteDialog.AlternateActionButton.Visible=True
SessionCompleteDialog.AlternateActionButton.Caption=“Purchase”
SessionCompleteDialog.Message=“Trial Session Time Limit Reached”+EndOfLine+EndOfLine+“Thank you for trying My Product”
SessionCompleteDialogButton=SessionCompleteDialog.ShowModal

Select Case SessionCompleteDialogButton
Case SessionCompleteDialog.ActionButton
  //user pressed "Contact Us"
  Dim EmailCMD as New Shell
  MsgBox "Please email us at:" + EndOfLine + EndOfLine +"blah@blah.com"
  
Case SessionCompleteDialog.AlternateActionButton
  Dim HTTPCMD as New Shell
  HTTPCMD.Execute("""C:\\Program Files\\Internet Explorer\\iexplore.exe"" http://www.blah.com")
End select

#ENDIF[/quote]

just curious what if happened in MAC OSX about the shell you are using to open the website. Thanks!

It works just the same, the only reason I used the #If Target was to call IE instead of “open”.

`
Ie. For OSX

Dim SessionCompleteDialog as New MessageDialog
Dim SessionCompleteDialogButton as MessageDialogButton
SessionCompleteDialog.icon=MessageDialog.GraphicNote
SessionCompleteDialog.ActionButton.Caption=“Question?”
SessionCompleteDialog.CancelButton.Visible=False
SessionCompleteDialog.AlternateActionButton.Visible=True
SessionCompleteDialog.AlternateActionButton.Caption=“Purchase”
SessionCompleteDialog.Message=“Trial Session Time Limit Reached”+EndOfLine+EndOfLine+“Thank you for trying My Product”
SessionCompleteDialogButton=SessionCompleteDialog.ShowModal

Select Case SessionCompleteDialogButton
Case SessionCompleteDialog.ActionButton
//user pressed “Contact Us”
Dim EmailCMD as New Shell
MsgBox “Please email us at:” + EndOfLine + EndOfLine +"blah@blah.com"

Case SessionCompleteDialog.AlternateActionButton
Dim HTTPCMD as New Shell
HTTPCMD.Execute(“open http://www.cnn.com”)
End select
`

The HTTPCMD.Execute(“open http://www.cnn.com”) uses the Default Browser that OS X has as the user defined default browser.

HTH.

[quote=79593:@Mike Cotrone]It works just the same, the only reason I used the #If Target was to call IE instead of “open”.

`
Ie. For OSX

Dim SessionCompleteDialog as New MessageDialog
Dim SessionCompleteDialogButton as MessageDialogButton
SessionCompleteDialog.icon=MessageDialog.GraphicNote
SessionCompleteDialog.ActionButton.Caption=“Question?”
SessionCompleteDialog.CancelButton.Visible=False
SessionCompleteDialog.AlternateActionButton.Visible=True
SessionCompleteDialog.AlternateActionButton.Caption=“Purchase”
SessionCompleteDialog.Message=“Trial Session Time Limit Reached”+EndOfLine+EndOfLine+“Thank you for trying My Product”
SessionCompleteDialogButton=SessionCompleteDialog.ShowModal

Select Case SessionCompleteDialogButton
Case SessionCompleteDialog.ActionButton
//user pressed “Contact Us”
Dim EmailCMD as New Shell
MsgBox “Please email us at:” + EndOfLine + EndOfLine +"blah@blah.com"

Case SessionCompleteDialog.AlternateActionButton
Dim HTTPCMD as New Shell
HTTPCMD.Execute(“open http://www.cnn.com”)
End select
`

The HTTPCMD.Execute(“open http://www.cnn.com”) uses the Default Browser that OS X has as the user defined default browser.

HTH.[/quote]
I see, thanks! maybe ShowURL("http://www.realsoftware.com ") is better, you don’t have to write separate codes for different platform. Just FYI.

Bo thank you! I didn’t realize that ShowURL was there. I will use this to simplify my code in a few areas. Thank you!!