Message box formatting

Message box formatting

brad.jackson
Enthusiast Enthusiast
1,216 Views
4 Replies
Message 1 of 5

Message box formatting

brad.jackson
Enthusiast
Enthusiast

Is there a way to format the message text in an ilogic message box (control when text needs to be put on a new line).  Also; if they exist; would anyone know where I might be able to find a list of operators / controls for message boxes along these lines?

 

Example:

As it is now.

MessageBox.Show("Due to remainder value being less than the minimum allowable, the Max And Remainder selection has been removed from the split style list.  If the Max And Remainder was previously selected it has been changed to All Equal", "Remainder Piece Too Short")
Due to remainder value being less than the minimum allowable, the Max And Remainder selection has been removed from the split style list.  If the Max And Remainder was previously selected it has been changed to All Equal.

 As I would like to see it

Due to remainder value being less than the minimum allowable,
the Max And Remainder selection has been removed from the split style list.
If the Max And Remainder was previously selected it has been changed to All Equal"
,
"Remainder Piece Too Short")

 

0 Likes
Accepted solutions (1)
1,217 Views
4 Replies
Replies (4)
Message 2 of 5

WCrihfield
Mentor
Mentor

Hi @brad.jackson.  To force your message's text to wrap to the next line at a specific point, you can use vbCrLf, vbCr, vbLf, or vbNewLine (the vbNewLine still works, but is being phased out).  The 'Cr' represents a carriage return, a term used when mechanical type writers were popular, which meant to physically move the printing head back to the start of the line (left side).  The 'Lf' represents Line Feed, also relating to mechanical typewriters, which was when you physically fed the paper up one line, so you are ready to start typing on the next line down.

Here is an example of this in use:

MsgBox("Line 1" & vbCrLf & "Line 2" & vbCrLf & "Line 3")
'or
MessageBox.Show("Line 1" & vbCrLf & "Line 2" & vbCrLf & "Line 3")

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 5

CCarreiras
Mentor
Mentor
Accepted solution

HI!

 

I use something like this:

Tip: I find it easier to preview the final result, add "blank" lines, etc.

 

i = MessageBox.Show("Error: Curvature Radius must be greater than Tube Radius." _
& vbLf & "Enter values which respect this rule." _
& vbLf & "" _
& vbLf & "Temporarily, the radius values will be set to:" _
& vbLf & "Curvature Radius = 2x Tube Radius", " Error!!Insufficient Curvature Radius ", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation)

 Preview:

ccarreiras_0-1662040489303.png

 

CCarreiras

EESignature

Message 4 of 5

brad.jackson
Enthusiast
Enthusiast

@WCrihfield 

Perfect.  Thanks.  I have another question on this subject.  Is there a way to turn on word wrap or move to the next line in ilogic for a line of code that is longer than the screen is wide.  That would be great if I didnt have to scroll to the right to see all of my code.  I tried just using the enter key to move to the next line, but ilogic does not seem to like that.

bradjackson_0-1662041142205.png

 

0 Likes
Message 5 of 5

brad.jackson
Enthusiast
Enthusiast

@WCrihfield 

@CCarreiras 

I see now where you included an example of how to better format the actual line of code in ilogic to "wrap' a long line for better readability.  Thanks again.

bradjackson_0-1662041473229.png

 

0 Likes