Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to create a customize messagebox with text on 3 separate or new lines

750 views
Skip to first unread message

harlibra

unread,
Jan 26, 2010, 5:04:53 PM1/26/10
to
I am trying to create a messagebox with text on 3 different lines
instead of a messagebox with large width. I think there is a way using
~r~n but I don't know how. I want the following 3 lines in the
variable ls_new_string to show in a messagebox on 3 lines.

ls_new_string = "You were allocated the following agencies:" +
ls_ag_allocated + &
"You were successfully able to unlock for : " + string( ls_allowon) +
&
"You were unable to unlock for: " + string(ls_notallowon)

Messagebox("Unlock My RISER Account",ls_new_string, Information!)

Terry Dykstra [TeamSybase]

unread,
Jan 26, 2010, 5:22:12 PM1/26/10
to
~r~n is indeed the way to go:

ls_new_string = "You were allocated the following agencies:" +
ls_ag_allocated + &

"~r~nYou were successfully able to unlock for : " + string( ls_allowon) +
&
~r~n"You were unable to unlock for: " + string(ls_notallowon)


--
Terry Dykstra (TeamSybase)
http://powerbuilder.codeXchange.sybase.com/
http://casexpress.sybase.com
product enhancement requests:
http://my.isug.com/cgi-bin/1/c/submit_enhancement

"harlibra" <harl...@yahoo.com> wrote in message
news:126bdf07-8e5c-43ce...@o28g2000yqh.googlegroups.com...

300ZX

unread,
Jan 26, 2010, 5:25:31 PM1/26/10
to
Try this and adjust as required if I didn't put the carriage return in
the right spot. You might want to add ~t to the lower 2 lines to line
them up if I understand what you're trying to show


ls_new_string = "You were allocated the following agencies:~r~n" +
ls_ag_allocated + &
"You were successfully able to unlock for : ~r~n" + string( ls_allowon) +


&
"You were unable to unlock for: " + string(ls_notallowon)

Bruce Armstrong

unread,
Jan 27, 2010, 10:52:07 AM1/27/10
to

And realize that when your customers move to Vista or later operating
systems it will format the messagebox differently and mess up
everything you've done to format the string. I'd suggest leaving it
as one long string.

-----------------------------------

My Web 2.0 Stuff

Blog: http://bruce.pbdjmagazine.com/
Facebook: http://www.facebook.com/people/Bruce-Armstrong/1600223798
Fotki: http://public.fotki.com/brucearmstrong/
LinkedIn: http://www.linkedin.com/in/bruceaarmstrong
Twitter: http://twitter.com/bruce_armstrong
YouTube: http://www.youtube.com/user/brucearmstrong

metawizard2

unread,
Jan 27, 2010, 11:14:26 AM1/27/10
to
Another solution would be to create your own response window, and pass
the values that will be changing to it inside an attribute object.
Then you could control the layout on the response window by creating
three single line edits, spaced exactly where you want them, and would
be covered down the road if Windows 7 will show it differently.

For example ( and this is off the top of my head, so may be a few
syntax errors ):
create a non-visual object called n_msg_attrib
Give it two instance variables: string is_allowon, is_notallowon

create a window called w_msg_agencies ( or whatever ) and make it a
response window
Give it three single line edits spaced where you want them, and an OK
button
In the open event, code the following:
n_msg_attrib ln_msg_attrib
ln_msg_attrib = create n_msg_attrib

ln_msg_attrib = Message.PowerObjectParm
sle_1.text = "You were allocated the following agencies:"
sle_2.text = "You were successfully able to unlock for : " +
ln_msg_attrib.is_allowon
sle_3.text = "You were unable to unlock for: " +
ln_msg_attrib.is_notallowon

Destroy ln_msg_attrib

For the Clicked event of the Ok button add:
Close( w_msg_agencies )

In your script that was calling the messagebox, change the logic to:
n_msg_attrib ln_msg_attrib
ln_msg_attrib = create n_msg_attrib

ln_msg_attrib.is_allowon = string( ls_allowon)
ln_msg_attrib.is_notallowon = string( ls_notallowon )

OpenWithParm( w_msg_agencies, ln_msg_attrib )

destroy ln_msg_attrib

Terry Dykstra [TeamSybase]

unread,
Jan 27, 2010, 1:03:53 PM1/27/10
to
Mess up in what way? Can you show a picture of an XP versus Vista/W7
Messagebox PB formatted messagebox?

"Bruce Armstrong" <NOCANSPAM_br...@yahoo.com> wrote in message
news:77o0m55f2sf1s9kfl...@4ax.com...

300ZX

unread,
Jan 27, 2010, 1:08:13 PM1/27/10
to
I'm curious as well...haven't seen or heard of a problem yet

Chris Pollach

unread,
Jan 28, 2010, 12:20:04 AM1/28/10
to
FWIW: The "~r~n" works the same for me on W7 (PB versions 11.2 through
12.NET)

--

Regards ... Chris
ISUG - Communications Director
http://chrispollach.pbdjmagazine.com


"Bruce Armstrong" <NOCANSPAM_br...@yahoo.com> wrote in message
news:77o0m55f2sf1s9kfl...@4ax.com...
>

Bruce Armstrong

unread,
Jan 28, 2010, 8:48:43 PM1/28/10
to

I don't have any any more, I already cleaned mine up. It's not
something limited to PB though:

http://social.msdn.microsoft.com/Forums/en/windowsuidevelopment/thread/20ec772b-5686-4482-b530-f4c8522caab7

http://www.eggheadcafe.com/software/aspnet/32267907/msgbox-width-limit-in-vis.aspx

Vista will tend to break long lines earlier. If you add your own line
breaks and the length of the line you're allowing is longer than when
Vista will break you'll get the Vista break, followed by your own
break in the middle of the next line.


On 27 Jan 2010 10:03:53 -0800, "Terry Dykstra [TeamSybase]"
<tddy...@forestoil.ca> wrote:

>Mess up in what way? Can you show a picture of an XP versus Vista/W7
>Messagebox PB formatted messagebox?

Bruce Armstrong

unread,
Jan 28, 2010, 8:49:36 PM1/28/10
to

That's nice. It wasn't particularly relevant to the point I was
making though.

On 27 Jan 2010 21:20:04 -0800, "Chris Pollach"
<cpol...@travel-net.com> wrote:

>FWIW: The "~r~n" works the same for me on W7 (PB versions 11.2 through
>12.NET)

0 new messages