In the. NET Framework, there is no similar InputBox function in VB, although it can be referenced by VB runtime to use VB's InputBox in the. NET program except VB, but why not write a class to achieve similar function?
The following class implements the functionality of a similar InputBox function:
public static string Showinputbox (String title,string keyInfo)
{
InputBox InputBox = new InputBox ();
InputBox. Text =title;
if (Keyinfo.trim ()!= string. Empty)
Inputbox.lblInfo.Text =keyinfo;
InputBox. ShowDialog ();
return inputbox.txtData.Text;
}
}
}
You can call the static method of the class directly Showinputbox, where the title argument is the text of the Text,keyinfo parameter of the dialog box is the label lblinfo (which can display the custom information). The specific call is as follows:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service