Can You Customize Message Box Buttons in Visual Basic 6?

  • Thread starter Thread starter dt19
  • Start date Start date
  • Tags Tags
    Visual
AI Thread Summary
In VB, while you can customize message box buttons, options are limited. To change button text, you typically need to create a custom message box instead of modifying the default one. This involves designing a form that mimics the built-in message box functionality. Although it is technically possible to change button text within the default message box, it requires advanced knowledge of the Windows operating system and can only be done after the window is instantiated. Creating a custom message box is recommended for flexibility and ease of use, allowing for any desired button text, such as "goodbye" for an exit command.
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' ?
 
Technology 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.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top