Click here to Skip to main content
11,709,581 members (49,903 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# GUI
Hello, I want to use an InputBox in a C Sharp GUI. How can I do that?
Posted 6-Oct-10 22:15pm
Edited 6-Oct-10 23:15pm
Johnny J.131.3K
v2
Comments
shakil0304003 at 7-Oct-10 4:20am
   
What do you mean by inputbox, please explain?
Toli Cuturicu at 8-Oct-10 15:22pm
   
What's an InputBox?? There is no such control!
Johnny J. at 17-Oct-10 16:47pm
   
@Toli: You shouldn't make comments to something you clearly know nothing about...
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

See here[^].
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

@ 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]
  Permalink  
v5
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 525
1 OriginalGriff 250
2 Peter Leow 219
3 Maciej Los 185
4 Mika Wendelius 160
0 OriginalGriff 9,428
1 Sergey Alexandrovich Kryukov 9,037
2 CPallini 5,189
3 Maciej Los 4,991
4 Mika Wendelius 3,856


Advertise | Privacy | Mobile
Web01 | 2.8.150819.1 | Last Updated 17 Oct 2010
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100