1 button2.w.mclick (); this method simulates a button2 click event.
2. If there is an item, do not add it.When no entry is added in ComboBox. Remember this idea
if (createEngineTypeCombox.Items.Count == 0)
{ createEngineTypeCombox.Items.Add(m_engineType[1]);
createEngineTypeCombox.Items.Add(m_engineType[2]);
createEngineTypeCombox.Items.Add(m_engineType[3]);
createEngineTypeCombox.Items.Add(m_engineType[4]);
createEngineTypeCombox.Items.Add(m_engineType[5]);
createEngineTypeCombox.Items.Add(m_engineType[6]);
createEngineTypeCombox.SelectedIndex = 0;
}3How to center and dock the winform button at the bottom
Set the anchor of the control (button) to bottom, and place the control (button) in the middle, no matter how the form is dragged or maximized, its position is always centered at the bottom.
For example, set:
Winform changes the border color of the button:
The property above flatstyle: flatappearance can be the border style of the button.
If (E. Button = 4) // 4 indicates the middle mouse button{
Axsupermap. Action = seaction. scapan;
}
Mouse button:
1 left button
2 right button
3 left and right buttons
4 middle button
5 left and middle buttons
6 Right and middle buttons
7 all buttons
C # Time required to test the running of a code segmentUsing system. diagnostics;
Stopwatchwatch = new stopwatch ();
Watch. Start ();
// Code to be tested
Watch. Stop ();
Longwatchtime = watch. elapsedmilliseconds; // time spent
Result = system. environment. newline.