Do not show this message again

  • Thread starter Thread starter moondog
  • Start date Start date
M

moondog

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,
(e-mail address removed)
 
moondog said:
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,
(e-mail address removed)

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
 
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,
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top