开发者

Modifying Messagebox?

Heloo t开发者_开发知识库here? Is there any way to change the color [back and forecolor] of a Messagebox? Iam using VB6.0... Thanks in advance!


To the best of my knowledge, there is no way to do this. There is, however, a typical workaround.

The most common method for creating custom "message boxes" in VB6 is to create a new form in your project that acts specifically as a message box. You Show it when you need it, and then Hide or Unload it when the user clicks "OK" or "Cancel" or whatever. You can size the form the same as (or differently from) a MsgBox, create the buttons you want, make the colors as you choose, etc. Whenever you would have a message box pop up to tell the user something, you will instead call this form and change the text/color/other variables to whatever you need them to be.

This may seem annoying at first, but once you've done it once, it's very easy to see how useful a tool this new form template can become. It's code you might find yourself frequently reusing between various applications.

If you need any help with forms or form events, this is a pretty good basic tutorial which should tell you most of what you need to make this work:
http://www.vb6.us/tutorials/understanding-forms-vb6-tutorial

Good luck!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜