Input Message Box in C#?

Is there any control like an Input Message Box (users of VB would recognize this)

I need a pop-up in the same form (pop-up not being a seperate form or a MDI child) for the Login Id and password

Any Suggestions

thx in advance,




Answer this question

Input Message Box in C#?

  • André Santana

    Just add the reference "Microsoft Visual Basic .NET Runtime" to your project.

    you needs to import "using Microsoft.VisualBasic;"

    then try to access the inputbox method.

    For ex:-

    string x = Interaction.InputBox("hi","hello","nothing",10,10);

    MessageBox.Show(x);



  • Malcolm Chu

    What I have is a form with a textbox on it with a TextValue property. Everytime I want to get some input from the user I just display the form and then get the textvalue back.
  • John123

    Believe it or not but this question is fairly common, especially coming from those who have previous experience with Visual Basic.  Unfortunately C# does not have anything like what you are after, but the beauty of .Net is that you are able to access methods/functions from other certain languages.

    In order to do this you need to Add a Reference to Microsoft.VisualBasic.dll.  Once you have done so you will have access to Microsoft.VisualBasic.Interaction.InputBox.  Below is an example of its use:

    Microst.VisualBasic.Interaction.InputBox("Did you know your question goes here ","Title","Default Text");

    You are also able to specify the x and y coordinates of the InputBox in the next two parameters.

     

    Hope this helps


  • ridvan

    HI,
    U can try out this thing.........

    Response.Write("<script>alert('Enter Your Message Here')</script>");



  • Matevz Gacnik

    Although I recommend using of VB old style. http://www.codeproject.com/useritems/novbruntimeref.asp

    How much does it cost you to create a new class deriving Form with few properties: Title, DefaultText, Value, etc



  • BobInIndy

    thx a lot !



  • Input Message Box in C#?