I would like to create a message box which has a textbox to enter a string in it how is this possible?
xanawa
-3
Junior Poster
Recommended Answers
Jump to PostSure it is. What you have to so, is to create a new Form, that will look like a messageBox. Put a textBox on it, and a buttons (Ok, Cancel, or what ever).
Simple.
Jump to PostAdd a reference to Microsoft.VisualBasic and you can do:
string response = Microsoft.VisualBasic.Interaction.InputBox("Prompt", "Title", "DefaultResponse",5,5);
While this gets the job done, I'd recommend making a form like Mitja Bonca suggested, as it's pure C# and infinitely more customizable.
Jump to Poststring response = Microsoft.VisualBasic.Interaction.InputBox("Prompt", "Title", "DefaultResponse",5,5);
is the best! It is harder to create another form, etc.
Remember to reference Microsoft.VisualBasic
All 11 Replies
Mitja Bonca
557
Nearly a Posting Maven
Xcelled194
28
Junior Poster in Training
Romil797
0
Light Poster
abelLazm
183
Postaholic
xanawa
-3
Junior Poster
abelLazm
183
Postaholic
xanawa
-3
Junior Poster
abelLazm
183
Postaholic
abelLazm
183
Postaholic
abelLazm
183
Postaholic
Mitja Bonca
557
Nearly a Posting Maven
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.