By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,571 Members | 966 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,571 IT Pros & Developers. It's quick & easy.

Do not show this message again

P: n/a
I have designed my own messagebox that simulates the standard .net
msgbox, but I've added a checkbox that says "Do not show this message
again". It works but it's a little bit clunky and non-standard. For
one thing my msgbox doesn't automatically size itself to the size of
the message being passed to it.

I was wondering if there's a proper way to do this in .net. Maybe
there's already a special msgbox built in that does this.

Thanks,
di****@verizon.net

Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies

P: n/a
moondog wrote:
I have designed my own messagebox that simulates the standard .net
msgbox, but I've added a checkbox that says "Do not show this message
again". It works but it's a little bit clunky and non-standard. For
one thing my msgbox doesn't automatically size itself to the size of
the message being passed to it.

I was wondering if there's a proper way to do this in .net. Maybe
there's already a special msgbox built in that does this.

Thanks,
di****@verizon.net


How are you showing the message? In a labelbox? Is so, just set the
box to autoresize. Then when you do the show of your form, just resize
the form to be just bigger than the label itself.

Another idea would be to use the Graphics.DrawString to draw the message
directly to the form in the paint event. Then use the
Graphics.MeasureString to get the size you need the form to be.

Hope it helps.
Chris
Nov 21 '05 #2

P: n/a
"moondog" <di****@verizon.net> schrieb:
I have designed my own messagebox that simulates the standard .net
msgbox


In addition to the other replies:

Implementing a message box with standard behavior
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=custommsgbox&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #3

P: n/a
Thanks Chris, I was looking for that Graphics.MeasureString property.

But I think the solution Wagner gave is the best.

I used it and it works great.

Thanks,
di****@verizon.net

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.