Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom buttons on msgbox 1

Status
Not open for further replies.

skyline666

Programmer
Oct 22, 2007
141
GB
Hi,

I seen on the net and on here that you can change the style of writing, which lines it goes on etc etc. But what I can't seem to find, and what I want, is to have a custom name for the buttons on some of my message boxes. So instead of choosing vbYesNo, I would have something like vbAllSelect instead (buttons being called All and Select instead of Yes and No). I know there is vbMsgBoxStyle, and thats what I thought you would use to change the names, but that just seems to only allow the standard buttons. Is there a way to change the names of the buttons?

Thanks in advance for any help,

Andrew
 
The easiest way to create a custom messagebox unfortunately is to create your own form and call that instead.

Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Thanks for the quick responses, I took a look at that code and theres a lot there for what I need!

HarleyQuinn, so would I make a form (and design it to look like a msgbox), and when the user clicks on the button to bring the msgbox up, it brings the form up instead, and then the two command buttons on the form would just do what they would if I had them in a standard msgbox?

Thanks,

Andrew
 
Yeah, hooking the window (and understanding what's going on with it [smile]) is the harder way [wink]

Basically yes, you can code the buttons on your custom box to do whatever you want them to.

Cheers

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Ok then. One thing I noticed though doing this way is you having the annoying ": Form" after the form name at the top, is there an easy way of not displayin this, as it would be nice if the user didn't know it was a form!

Thanks,

Andrew
 
If you change the caption that seems to do it for me.

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
You're welcome, glad I could help [smile]

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top