In. NET Framework does not have an InputBox function similar to that in VB. Although you can reference the Runtime of VB. NET program uses VB InputBox, but why not write a class to implement similar functions?
The following class implements functions similar to the InputBox function:
Using System;
Using System. Windows. Forms;
Namespace Input
{
/// <Summary>
/// Summary of clsInputBox.
/// </Summary>
Public class InputBox: System. Windows. Forms. Form
{
Private System. Windows. Forms. TextBox txtData;
Private System. Windows. Forms. Label lblInfo;
Private System. ComponentModel. Container components = null;
Private InputBox ()
{
InitializeComponent ();
}
Protected override void Dispose (bool disposing)
{
If (disposing)
{
If (components! = Null)
{
Components. Dispose ();
}
}
Base. Dispose (disposing );
}
Private void InitializeComponent ()
{
This.txt Data = new System. Windows. Forms. TextBox ();
This. lblInfo = new System. Windows. Forms. Label ();
This. SuspendLayout ();
//
// TxtData
//
This.txt Data. font = new System. drawing. font ("", 10.5F, System. drawing. fontStyle. regular, System. drawing. graphicsUnit. point, (System. byte) (134 )));