Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello, I want to use an InputBox in a C Sharp GUI. How can I do that?
Posted
Updated 6-Oct-10 23:15pm
v2
Comments
shakil0304003 7-Oct-10 4:20am    
What do you mean by inputbox, please explain?
Toli Cuturicu 8-Oct-10 15:22pm    
What's an InputBox?? There is no such control!
Johnny J. 17-Oct-10 16:47pm    
@Toli: You shouldn't make comments to something you clearly know nothing about...

See here[^].
 
Share this answer
 
v2
@ shakil0304003: InputBox is a VB function that works sort of like a MessageBox, only that you get a textbox where you can enter something and retrieve it when the user clicks ok.

In my opinion, InputBox is a stupid function because you have no way of restricting the user input (you can validate it afterwards, but the user can write anything he wants in the box). Plus: It looks like sh*t...

Much better to simply do a form yourself with a label, a textbox and ok/cancel buttons. That way you can also design the box to match the look and fell of the rest of your application. It will only require a few more lines of code...

If you absolutely insist on using the InputBox function, I'm sure it still exists somewhere in the Microsoft.VisualBasic namespace.

[EDIT]Have a look at This[^][/EDIT]
 
Share this answer
 
v5
InputBox is totally removed from C# and actually it doesnt need that. Rather you can create it of your own if you like. Just create a form and add a textbox and use it as an InputBox.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900