inputbox for C#

M

Melissa

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
 
D

Deepak

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

Regards

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

Ying-Shen Yu[MSFT]

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" <[email protected]>
| Sender: "Deepak" <[email protected]>
| References: <[email protected]>
| Subject: inputbox for C#
| Date: Wed, 24 Sep 2003 18:32:57 -0700
| Lines: 19
| Message-ID: <[email protected]>
| 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
| >.
| >
|
 
D

Deepak Kapoor

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
 
H

Herfried K. Wagner [MVP]

Hello,

Deepak Kapoor said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top