1 usingSystem;2 usingSystem.Collections.Generic;3 usingSystem.ComponentModel;4 usingSystem.Data;5 usingSystem.Drawing;6 usingSystem.Linq;7 usingSystem.Text;8 usingSystem.Threading.Tasks;9 usingSystem.Windows.Forms;Ten One namespaceproj_92 A { - Public Partial classForm1:form - { the PublicForm1 () - { - InitializeComponent (); - } + - Private voidForm1_Load (Objectsender, EventArgs e) + { ACHECKEDLISTBOX1.ITEMS.ADD ("China"); CHECKEDLISTBOX1.ITEMS.ADD ("United States"); atCHECKEDLISTBOX1.ITEMS.ADD ("Russia"); CHECKEDLISTBOX1.ITEMS.ADD ("United Kingdom"); -CHECKEDLISTBOX1.ITEMS.ADD ("France"); Checkedlistbox1.checkonclick =true; -TextBox1.Text = DateTime.Now.ToString ("H:mm:ss"); -Timer1. Enabled =true; -Timer1. Interval = -; - inHscrollbar1.maximum = -; Hscrollbar1.minimum =0; -Hscrollbar1.smallchange =2; Hscrollbar1.largechange =5; toVscrollbar1.maximum = -; Vscrollbar1.minimum =0; +Vscrollbar1.smallchange =2; Vscrollbar1.largechange =5; -Hscrollbar1.value =0; Vscrollbar1.value =0; the *Datetimepicker1.format =Datetimepickerformat.long; $Datetimepicker1.showcheckbox =true;Panax NotoginsengDatetimepicker1.showupdown =false; -TextBox3.Text =""; the +Linklabel1.linkcolor =Color.Blue; ALinklabel1.activelinkcolor =Color.green; the + - } $ $ Private voidButton1_Click (Objectsender, EventArgs e) - { - foreach(ObjectIteminchCheckedListBox1. CheckedItems) the { - LISTBOX1.ITEMS.ADD (item);Wuyi } the } - Wu Private voidTimer1_Tick (Objectsender, EventArgs e) - { AboutTextBox1.Text = DateTime.Now.ToString ("H:mm:ss"); $ - } - - Private voidHscrollbar1_scroll (Objectsender, ScrollEventArgs e) A { +TextBox2.Text = hScrollBar1.Value.ToString ("D"); theVscrollbar1.value =Hscrollbar1.value; - } $ the Private voidVscrollbar1_scroll (Objectsender, ScrollEventArgs e) the { theTextBox2.Text = vScrollBar1.Value.ToString ("D"); theHscrollbar1.value =Vscrollbar1.value; - } in the Private voidButton2_Click (Objectsender, EventArgs e) the { About if(Convert. ToInt16 (TextBox2. Text) >=0&& Convert. ToInt16 (TextBox2. Text) <= - ) the { theHscrollbar1.value =convert.toint16 (TextBox2.Text); theVscrollbar1.value =convert.toint16 (TextBox2.Text); + } - } the Bayi Private voidDatetimepicker1_valuechanged (Objectsender, EventArgs e) the { theTextBox3.Text = dateTimePicker1.Value.ToString ("yyyy. MM.DD Hh:mm:ss"); - } - the Private voidLinklabel1_linkclicked (Objectsender, LinkLabelLinkClickedEventArgs e) the { theSystem.Diagnostics.Process.Start ("http://blog.sina.com.cn/s/articlelist_2379298071_0_1.html"); the } - } the}
List control with check box, Timer control, scroll bar control, month calendar control, datetime control, Hyperlink control
C # Windows Programmer Learning-2