I am making a small app in Visual C++ in Microsoft Visual Studio and want to get some text from the user. I want to have a message box with a text box where the user can input the data. I know how to display a message box, but there is no text box for input. How can make a message box with input.
-
perhaps you would like to show us the code with what you've tried thus far, so we can comment on it? – hetepeperfan Jul 16 '13 at 18:52
-
@p1rox, I've never heard of such a thing for C++. – chris Jul 16 '13 at 18:59
-
1Since you're already doing C++/CLI (which is distinct from C++), you'll have the easiest time whipping up a small form. – chris Jul 16 '13 at 19:02
3 Answers
There isn't anything pre-packaged that does this exactly but you can create a form and use the ShowDialog() method. You'll need to design the form but it doesn't sound like you need to put a lot on it. I recommend reading the following: http://msdn.microsoft.com/en-us/library/c7ykbedk.aspx

- 11,116
- 13
- 61
- 95
Check this: Prompting a user with an input box? [C++]
Shortly, you must make your own input dialog with current WinSDK. Wether you going to stick with the WinSDK or going to Qt, wxwidget, or anything else is up to you.
You could use DialogBoxIndirect
()^ to instantiate an in-memory dialog template^.
It does not require any resources (you compose it in code), it's reusable... but it's not very easy to build.
PS: You can also take a look on CodeProject.com^, maybe they have what you need^.

- 12,760
- 3
- 50
- 57