Customizing a MessageBox-like small form operation

Source: Internet
Author: User

1, the actual small form interface is as follows

2, the code is as follows

Private voidInputBox (stringCaptionstringOrderNo) {Form Inputform=NewForm (); Inputform.minimizebox=false; Inputform.maximizebox=false; Inputform.startposition=Formstartposition.centerscreen; Inputform.width=375; Inputform.height=236; Inputform.text="Business Analysis"; Inputform.maximizebox=false; Inputform.formborderstyle=System.Windows.Forms.FormBorderStyle.FixedDialog; TextBox TbE=NewTextBox (); Tbe.left= -; Tbe.top= -; Tbe.width= -; Tbe.height= -; Tbe.multiline=true; Tbe.parent=Inputform; Tbe.text=caption;            Tbe.selectall (); Label Lab=NewLabel (); Lab. Left= -; Lab. Top=145; Lab. Height= -; Lab. Width= -; Lab. Parent=Inputform; Lab. Text="(hint, the input content is limited to 500 characters!) )"; Button Btnok=NewButton (); Btnok. Left= -; Btnok. Top= the; Btnok. Parent=Inputform; Btnok. Text="Determine"; Inputform.acceptbutton= Btnok;//return ResponseBtnok. DialogResult =DialogResult.OK; Button btncancal=NewButton (); Btncancal. Left= the; Btncancal. Top= the; Btncancal. Parent=Inputform; Btncancal. Text="Cancel"; Btncancal. DialogResult=DialogResult.Cancel; Try            {                if(Inputform.showdialog () = =DialogResult.OK) {if(TbE.Text.Trim (). Length > -) {MessageBox.Show ("Enter the length of the character, maximum no more than 500! ","Warm Tips"); return; }                    if(String.Compare (caption, TbE.Text.Trim (),true) !=0) {StringBuilder strwhere=NewStringBuilder (); stringMebo = TbE.Text.Trim (). Length > -? TbE.Text.Trim (). Substring (0, $) +"....": TbE.Text.Trim (); Strwhere.appendformat (@"UPDATE ta_currencyqueryex_exception SET ycremark=n ' {0} ', updateby= ' {1} ', updatedt= ' {2} ' WHERE orderno= ' {3} '", TbE.Text.Trim (), Sessionauth.userid, DateTime.Now, OrderNo); Winsrv.executenonquery (Strwhere.tostring (),Newobject[] {}); Txt_col424.text=Sessionauth.username; Txt_col425.text=DateTime.Now.ToString (); Txt_col423.text=Mebo; stringLoginfo ="waybill number"+ OrderNo +"The inspector analyzed the information and was"+ sessionauth.username+"Modify"; Clsdatabase.gsetsystemlog ("Business Analysis", Loginfo,"Inspector Analysis"); }                                 }            }            finally{inputform.dispose (); }        }
View Code

Customizing a MessageBox-like small form operation

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.