如何获得c#的输入框? [英] How can i get an input box to c#?

查看:109
本文介绍了如何获得c#的输入框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我需要为C#程序生成一个输入框,过去我在需要时使用了VB.NET输入框一个但已经丢失或找不到一个例子我相信格里夫回答了这个问题。我通过文章用于WindowsForms的C#输入框 [ ^ ]然而,这使用VS2010,我不用于这个项目,因为它需要.NET2(将在Windows 2000上运行!及以上)。

那么你们这样做的方式是什么?而且你还想提醒我让VB进入C#的方式(!)

Glenn



我试过的:



看看之前项目的灰烬,祷告,谷歌!

Hi All,

I have need to produce an Input Box for a C# program, in the past I have used the VB.NET input box when I needed one but have lost or can't find an example I believe Griff answered it. I found a suitable C# widget via the article Input Box in C# for WindowsForms[^] However this uses VS2010 which I am not using for this project as it needs to .NET2 (will run on Windows 2000! and up).
So which is the way you guys would do it? And also would you mind reminding me of the way to get VB into C#(!)
Glenn

What I have tried:

Looked through the ashes of previous projects, Prayer, Google!

推荐答案

string input = Microsoft.VisualBasic.Interaction.InputBox("Title", "Prompt", "Default", 0, 0);  



正确的谢谢Stack OverFlow!快速回答的第一条规则就是不要问!很多次我问了一个问题并且在一个不同的切线上出现了!: - )


Right Thanks Stack OverFlow! The first rule of quick answers is don't ask! Many times I have asked a question and gone off on a different tangent!:-)


StackOverflow上的其他解决方案 - 什么是VB.net的InputDialog的C#版本? - 堆栈溢出 [ ^ ]

大多数答案建议
Other solution on StackOverflow - What is the C# version of VB.net's InputDialog? - Stack Overflow[^]
Most of the answers suggest
using Microsoft.VisualBasic;

但我无法让自己这样做。该帖子的解决方案之一给出了一个非常简单的对话框示例,您可以在其中放置任何类型的控件

but I just can't bring myself to do that. One of the solutions on that post gives a very simple dialog box example on which you could place any type of control


这篇关于如何获得c#的输入框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆