QUOTE (lignumaqua @ July 04, 2013 12:47 am) |
PS - Another option, if you don't want the message in a memo box, but would like it to look like a normal Windows message. Use a Label on the form instead and change its Caption property dynamically using EditForm(). |
That will work for short messages - I use a memo box because labels do not wrap if the message exceeds the width of the label. Memo boxes do wrap long text and you can add vertical scroll bars if you have a really long message, such as return data, although that isn't likely in this scenario.

The code I posted was quick and dirty 'proof of concept'. To get it to look like a normal windows message I do three things:
1) Make the memo box the width of the form minus 2 pixels, center it horizontally and place the box at the top of the form (i.e. Memo1 property Top=0) so only the bottom edge of the box's boundary is visible.
2) Make the background color of the memo box the same as the background color of the form, and
3) Set the "Read Only" property of the Memo box to "Yes" so that users cannot change what appears in the memo box (again, probably not an issue in this scenario).
