vbnewline and MessageBoxIcon

D

Dan

Hello,

I'm trying to build a simple message box with multiple lines and windows
sytems icons. For some reason, Infopath doesn't recognize VBNEWLINE or
MessageBoxIcon.


Problem 1:
MessageBox.Show(MessageBoxIcon.Stop & " You cannot save a blank form. Use
the search function first.")

This line works but only displays a number rather than the icon for Stop.

Problem 2:
MessageBox.Show("You cannot save a blank form." & vbnewline & "Use the
search function first.")

In the code window, VBNEWLINE is underlined as not declared.

Can anyone please help?
 
S

S.Y.M. Wong-A-Ton

To use MessageBox you have to add a reference to the System.Windows.Form DLL
and then an Imports statement for that namespace. Then you should be able to
use a statement like:

MessageBox.Show("You cannot save a blank form. Use the search function
first.", "Message from Me", MessageBoxButtons.OK, MessageBoxIcon.Stop)

To get a line break, you need to add an Imports statement to the
Microsoft.VisualBasic namespace. Then you should be able to use a statement
like:

MessageBox.Show("You cannot save a blank form." & ControlChars.NewLine &
"Use the search function first.")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top