inputbox for C#

Discussion in 'Microsoft Dot NET Framework Forms' started by Melissa, Sep 24, 2003.

  1. Melissa

    Melissa Guest

    Hello,
    Just wondering if there is an equivelant available to C#
    for quick string input. I am NOT using vb.net so i cant
    use that version.

    TIA,
    Mel
     
    Melissa, Sep 24, 2003
    #1
    1. Advertisements

  2. Melissa

    Deepak Guest

    No, there is no Input box in C#. You will have to create
    your own.

    Regards

    Deepak
    #*#*#*#*#*#*#*#
    I Code, therefore I am

    >-----Original Message-----
    >Hello,
    >Just wondering if there is an equivelant available to C#
    >for quick string input. I am NOT using vb.net so i cant
    >use that version.
    >
    >TIA,
    >Mel
    >.
    >
     
    Deepak, Sep 25, 2003
    #2
    1. Advertisements

  3. Hi Melissa,
    The .NET Framework has provided a InputBox for VB.NET. and we can reuse it
    in other .NET languages.
    You need reference the "Microsoft.VisualBasic.dll" assembly and use it like
    this,
    string str = Interaction.InputBox("hello:","This is an
    InputBox","World!",30,40);
    Note, due to C# didn't support the optional value, you need to provide full
    params to call the InputBox method.
    However, you may define a wrapper method to do this.

    Thanks, if you have any further questions , please let me know.

    Best regards,

    Ying-Shen Yu [MSFT]
    Microsoft Online Partner Support
    Get Secure! - www.microsoft.com/security

    This posting is provided "AS IS" with no warranties and confers no rights.
    You should not reply this mail directly, "Online" should be removed before
    sending, Thanks!

    --------------------
    | Content-Class: urn:content-classes:message
    | From: "Deepak" <>
    | Sender: "Deepak" <>
    | References: <11fd01c382c2$d820f250$>
    | Subject: inputbox for C#
    | Date: Wed, 24 Sep 2003 18:32:57 -0700
    | Lines: 19
    | Message-ID: <102001c38304$f2c217a0$>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="iso-8859-1"
    | Content-Transfer-Encoding: 7bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
    | Thread-Index: AcODBPK/ttPWxplzT5C6I48yAGlvbQ==
    | Newsgroups: microsoft.public.dotnet.framework.windowsforms
    | Path: cpmsftngxa06.phx.gbl
    | Xref: cpmsftngxa06.phx.gbl
    microsoft.public.dotnet.framework.windowsforms:53060
    | NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
    | X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
    |
    | No, there is no Input box in C#. You will have to create
    | your own.
    |
    | Regards
    |
    | Deepak
    | #*#*#*#*#*#*#*#
    | I Code, therefore I am
    |
    | >-----Original Message-----
    | >Hello,
    | >Just wondering if there is an equivelant available to C#
    | >for quick string input. I am NOT using vb.net so i cant
    | >use that version.
    | >
    | >TIA,
    | >Mel
    | >.
    | >
    |
     
    Ying-Shen Yu[MSFT], Sep 25, 2003
    #3
  4. Hi Ying,
    I was under the impression that Microsoft.VisualBasic.dll namespace is
    there only to help VB6 programers find things that they so much loved
    (such as VbCrlf, Input Box...), the idea still being to use the
    framework as much as possible. I also think that this namespace
    discourages one to explore many rich features provided by the
    framework, thus its use should be discouraged. Personally I don't do
    much VB.NET, but whenever I have to, I make sure that I do not include
    this namespace.

    Just a bit of opinion

    Regards

    Deepak
    #*#*#*#*#*#*#*#*#*#*#*#
    I Code, therefore I am




    (Ying-Shen Yu[MSFT]) wrote in message news:<>...
    > Hi Melissa,
    > The .NET Framework has provided a InputBox for VB.NET. and we can reuse it
    > in other .NET languages.
    > You need reference the "Microsoft.VisualBasic.dll" assembly and use it like
    > this,
    > string str = Interaction.InputBox("hello:","This is an
    > InputBox","World!",30,40);
    > Note, due to C# didn't support the optional value, you need to provide full
    > params to call the InputBox method.
    > However, you may define a wrapper method to do this.
    >
    > Thanks, if you have any further questions , please let me know.
    >
    > Best regards,
    >
    > Ying-Shen Yu [MSFT]
    > Microsoft Online Partner Support
    > Get Secure! - www.microsoft.com/security
    >
    > This posting is provided "AS IS" with no warranties and confers no rights.
    > You should not reply this mail directly, "Online" should be removed before
    > sending, Thanks!
    >
    > --------------------
    > | Content-Class: urn:content-classes:message
    > | From: "Deepak" <>
    > | Sender: "Deepak" <>
    > | References: <11fd01c382c2$d820f250$>
    > | Subject: inputbox for C#
    > | Date: Wed, 24 Sep 2003 18:32:57 -0700
    > | Lines: 19
    > | Message-ID: <102001c38304$f2c217a0$>
    > | MIME-Version: 1.0
    > | Content-Type: text/plain;
    > | charset="iso-8859-1"
    > | Content-Transfer-Encoding: 7bit
    > | X-Newsreader: Microsoft CDO for Windows 2000
    > | X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
    > | Thread-Index: AcODBPK/ttPWxplzT5C6I48yAGlvbQ==
    > | Newsgroups: microsoft.public.dotnet.framework.windowsforms
    > | Path: cpmsftngxa06.phx.gbl
    > | Xref: cpmsftngxa06.phx.gbl
    > microsoft.public.dotnet.framework.windowsforms:53060
    > | NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
    > |
    > | No, there is no Input box in C#. You will have to create
    > | your own.
    > |
    > | Regards
    > |
    > | Deepak
    > | #*#*#*#*#*#*#*#
    > | I Code, therefore I am
    > |
    > | >-----Original Message-----
    > | >Hello,
    > | >Just wondering if there is an equivelant available to C#
    > | >for quick string input. I am NOT using vb.net so i cant
    > | >use that version.
    > | >
    > | >TIA,
    > | >Mel
    > | >.
    > | >
    > |
     
    Deepak Kapoor, Sep 25, 2003
    #4
  5. Hello,

    "Deepak Kapoor" <> schrieb:
    > I was under the impression that Microsoft.VisualBasic.dll
    > namespace is there only to help VB6 programers find things
    > that they so much loved (such as VbCrlf, Input Box...),#


    No, the Visual Basic .NET Runtime Libarary provides some _shortcuts_ for
    classes/methods of the framework that make work easiert to the developer.
    Nevertheless the 'InputBox' function is only available in this library and
    not in the Framework Class Libarary.

    > the idea still being to use the framework as much as possible.


    Why not use language-specific "shortcuts"?

    > I also think that this namespace discourages one to explore
    > many rich features provided by the framework, thus its use should
    > be discouraged.


    I don't think so. Many things in the 'Microsoft.VisualBasic' namespace are
    not directly availabe in the framework.

    > Personally I don't do much VB.NET, but whenever I have to,
    > I make sure that I do not include this namespace.


    ROFL

    --
    Herfried K. Wagner
    MVP ยท VB Classic, VB.NET
    http://www.mvps.org/dotnet
     
    Herfried K. Wagner [MVP], Sep 25, 2003
    #5
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. news.microsoft.com

    Odd problem with InputBox

    news.microsoft.com, Jul 10, 2003, in forum: Microsoft Dot NET Framework Forms
    Replies:
    2
    Views:
    431
    news.microsoft.com
    Jul 10, 2003
  2. Guest

    InputBox

    Guest, May 14, 2004, in forum: Microsoft Dot NET Framework Forms
    Replies:
    2
    Views:
    159
    Marc Butenko
    May 14, 2004
  3. Guest

    InputBox in VC#.net?

    Guest, Dec 1, 2004, in forum: Microsoft Dot NET Framework Forms
    Replies:
    5
    Views:
    523
    Guest
    Dec 1, 2004
Loading...

Share This Page