vb.net 如何创建一个用户可以输入文本的可视化基本对话框

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21854102/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 17:25:47  来源:igfitidea点击:

How to create a visual basic dialog box that users can input text

vb.netdialog

提问by Harry Jones

I have a program that lets users create very basic images with a picture and a greeting. I want the user to be able to select the text.

我有一个程序,可以让用户创建带有图片和问候语的非常基本的图像。我希望用户能够选择文本。

Public Sub setText(ByVal aMessage As String)
    fmessage.Text = aMessage

This is the method i want to invoke. How do I create a dialog box that lets users input what they want so that fmessageholds that value?

这是我要调用的方法。如何创建一个对话框,让用户输入他们想要的内容,以便fmessage保存该值?

回答by TylerDurden

You want an InputBoxI think

你想要一个InputBox我认为

http://msdn.microsoft.com/en-us/library/6z0ak68w(v=vs.90).aspx

http://msdn.microsoft.com/en-us/library/6z0ak68w(v=vs.90).aspx

dim myValue as String = InputBox("Enter Value", "Enter Value", "Please Enter Value")