0

![enter image description here][1]How do you use a messagebox to ask for user input using c#?

I tried the 'using Microsoft.Visualbasic;' and Microsoft.VisualBasic.Interaction.InputBox <--- the "Interaction" namespace doesn't exist.

Is there another way of asking a user for input or do I just create another form?

I get this error: The type or namespace name 'Interaction' does not exist in the namespace 'Microsoft.VisualBasic' (are you missing an assembly reference?)

1
  • I think you can use it only to check which answer boxes have been press (like OK, Cancel, etc). However, in C# you can import the VB library and use inputBox if you want to actually get custom or build your own. Refer here... stackoverflow.com/questions/97097/… Commented Mar 14, 2015 at 2:55

1 Answer 1

0

You can use the input box by adding a reference to Microsoft.VisualBasic and then doing a :

Microsoft.VisualBasic.Interaction.InputBox("Hello");

However, most of the time this box is too limiting and you are better off writing a custom input form to allow you to get the input you desire.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.