First, the process
Drag controls to change the property write event
A variety of control CheckBox, textBox, pictureBox, Label, panel ...
Control ---- property (the cursor the Cursor
text text
font font
{Enable Timer clock is enabled; the Interval interval (s)}
......)
A variety of attributes remove borders, change the background color, transparency ...
+ C + V ctrl ctrl
ctrl the Z + (previous step) Ctrl + Y (anti-withdrawal)
For each component named, in order to facilitate the distinction write event.
What happens after clicking the button: (Click) (small lightning property bar) "write event"
write event: by code completion
, double-click to write code into the page
MouseEnter
MouseLeave
Click
......
QQ landing page portion of the code is as follows:
private void lblFindPwd_MouseEnter(object sender, EventArgs e) { lblFindPwd.ForeColor = Color.Black; } private void lblFindPwd_MouseLeave(object sender, EventArgs e) { lblFindPwd.ForeColor = Color.FromArgb(166, 166, 166); } ② private void Panel1_MouseEnter(object sender, EventArgs e) { panel1.BackColor = Color.LightGray; } private void Panel1_MouseLeave(object sender, EventArgs e) { panel1.BackColor = SystemColors.Control; } private void Panel2_MouseEnter(object sender, EventArgs e) { panel2.BackColor = Color.LightGray; } private void Panel2_MouseLeave(object sender, EventArgs e) { panel2.BackColor = SystemColors.Control; } } } //Color code designed to be consistent, accurate If instead, do not forget the background color BackColor designer also to the precise value / * Private void pnlPwd_MouseEnter (SENDER Object, EventArgs E) { pnlPwd.BackColor Color.FromArgb = ( 193,193,193); } Private void pnlPwd_MouseLeave (SENDER Object, EventArgs E) { pnlPwd.BackColor = Color.FromArgb (229, 229, 229); } * / Private void pnlPwd_MouseEnter ( Object SENDER, EventArgs E) { pnlPwd.BackColor = Color. , FromArgb ( 193 , 193 , 193 ); } Private void pnlPwd_MouseLeave(object sender, EventArgs e) { pnlPwd.BackColor = Color.FromArgb(229, 229, 229); } private void txtPwd_TextChanged(object sender, EventArgs e) { pnlPwd.BackColor = Color.FromArgb(18, 183, 245); } private void picProfilePhoto_MouseEnter(object sender, EventArgs e) { timer1.Enabled = true; // the F10, --- single-step debugging, F5: proceed, the F10 + FN } Private void the timer1_Tick ( Object SENDER, EventArgs E) { // 100ms picMultiUserLogin.Location = new new Point ( picMultiUserLogin.Location.X + 10 , picMultiUserLogin.Location.Y ); } // multiple picture plus removed // entire movement process can be implemented by two Timer, if statement are employed BOOL isMoveRight; public const int MOVE_STEP = 10 ; Private void picProfilePhoto_MouseEnter ( Object SENDER, EventArgs E) // picture { Timer1.Enabled = to true ; // the F10, --- single-step debugging, F5: proceed, the F10 + FN isMoveRight = to true ; } Private void picProfilePhoto_MouseLeave ( Object SENDER , EventArgs E) { isMoveRight = to false ; } // 100ms, performs Private void the timer1_Tick ( Object SENDER, EventArgs E) { IF ((isMoveRight && picMultiUserLogin.Location.X <= 245) //右 || (!isMoveRight && picMultiUserLogin.Location.X >= 200)) //左 { //100ms if (isMoveRight) { picMultiUserLogin.Location = new Point( picMultiUserLogin.Location.X + MOVE_STEP, picMultiUserLogin.Location.Y //头像加号 ); } else { picMultiUserLogin.Location = new Point( picMultiUserLogin.Location.X - MOVE_STEP, picMultiUserLogin.Location.Y ); } } }