Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Message box formatting

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
brad.jackson
347 Views, 4 Replies

Message box formatting

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")

 

4 REPLIES 4
Message 2 of 5
WCrihfield
in reply to: brad.jackson

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
in reply to: brad.jackson

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
in reply to: CCarreiras

@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

 

Message 5 of 5
brad.jackson
in reply to: brad.jackson

@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

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report