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