InputBox in C #

Source: Internet
Author: User

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 )));

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.