C # Game-Assisted Scripting Learning record (September 3, 2017)
Use ideas
Use the ListBox control to display all my tasks and the tasks I have selected.
Left is listbox_ selected task , right is listbox_ task List
Double-click Add content to another ListBox list (from task List → selected task)
Using the double-click event in the ListBox, there are 2 double-click events, DoubleClick and MouseDoubleClick
I do not know what is the difference, try to feel the same operation, temporarily first use DoubleClick
Private voidListbox_ Task List _doubleclick (Objectsender, EventArgs e) { intindex =listbox_ Task List. SelectedIndex; Console.WriteLine ("The current selection is the first"+ Index. ToString () +"Items"); stringvalue; Value=listbox_ Task List. Items[index]. ToString (); Console.WriteLine ("the selection is as follows:"+value); Listbox_ selected tasks. Items.Add (value);}
Gets how many items are in the listbox
Function: Traverse all item Contents
int Shu;shu = listbox_ selected task. Items.Count;
Iterate through the contents of all items in a ListBox
Role: According to each of the obtained content to carry out the corresponding task, to achieve the free combination of tasks.
int Shu; string = listbox_ selected task. Items.Count; Console.WriteLine (" a total of " "Tasks"); for (int0; i < Shu; i++) { = listbox_ selected task. Items[i]. ToString (); Console.WriteLine (value);}
C # Game-Assisted Scripting tutorial--listbox controls