I'm making a custom message display Form and I want to resize the Form where the width will be dependent on the length of the longest line and the height will be dependent on the number of lines. All lines should be centered horizontally and vertically.
Examples:
The text line will be sent to a sub using vbCrLf's for each line, like this
ShowMessage "This is the first line" & vbCrLf & "and this is the second line" & vbCrLf & "this is the 3rd line"
I need to extract each line and determine the length of the longest line and how many lines there are.
EDIT:
Also, I need to point out, that if I were to send this:
ShowMessage "This is the first line" & vbCrLf & vbCrlf & "and this is the second line"
it needs to look like this:
Examples:
Code:
+-------------------------+
| This is the only line |
+-------------------------+
+--------------------------------+
| This is the first line |
| and this is the second line |
| this is the 3rd line |
+--------------------------------+
ShowMessage "This is the first line" & vbCrLf & "and this is the second line" & vbCrLf & "this is the 3rd line"
I need to extract each line and determine the length of the longest line and how many lines there are.
EDIT:
Also, I need to point out, that if I were to send this:
ShowMessage "This is the first line" & vbCrLf & vbCrlf & "and this is the second line"
it needs to look like this:
Code:
+--------------------------------+
| This is the first line |
| |
| and this is the second line |
+--------------------------------+