Can You Customize Message Box Buttons in Visual Basic 6?

  • Thread starter Thread starter dt19
  • Start date Start date
  • Tags Tags
    Visual
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 7K views
dt19
Messages
46
Reaction score
0
i'm learning a bit of VB at the moment and i wondered if it is possible to change the text of the message box buttons? like if you have a warning boxtriggered by some event, can you make it say something different to 'OK' ?
 
Physics news on Phys.org
Yes, but the choices are limited.
Type a comma after the prompt message.
It should pop up box with the options.
Multiple options are selected by typing + after the first option.

You can also write your own message box.
 
NoTime said:
Yes, but the choices are limited.
Type a comma after the prompt message.
It should pop up box with the options.
Multiple options are selected by typing + after the first option.

You can also write your own message box.


yes, i know you can have things other than ok (maybe i didn't make myself clear) but can you actually write your own text for the buttons? like if you had an 'exit' command button, could you have a message box pop up where you press a button that says 'goodbye' on it to leave the programme?
 
Just make your own, it will probably take you less time. Design a form. Put the required graphics on there, and call it when necessary. Pass whatever string to it, etc...
 
dt19 said:
yes, i know you can have things other than ok (maybe i didn't make myself clear) but can you actually write your own text for the buttons? like if you had an 'exit' command button, could you have a message box pop up where you press a button that says 'goodbye' on it to leave the programme?
Yes, it is possible.
It is very complex to do so and requires an indepth knowledge of windows o/s.
Even then, you can't actually change the text until the window is instantiated.

Much easier to write your own message box screen.
You can make it look and act just like the built in msgbox and you can make it say anything you want.