#region= = Slide to unlock part = =Private BOOLMouseDown//defines the bool value of the mouse click Private intCurX;//defines the position x coordinate when the mouse is clicked Private voidButton11_mousedown (Objectsender, MouseEventArgs e) {MouseDown=true; CurX= cursor.position.x;//get x-coordinate when clicked } Private voidButton11_mouseup (Objectsender, MouseEventArgs e)//determine whether the degree of movement meets the requirements{MouseDown=false; if(Cursor.position.x-curx > -) {panel3. Visible=false; } Else{button11. Location=NewPoint ( A,341); } } Private voidButton11_mousemove (Objectsender, MouseEventArgs e) { if(MouseDown) {button11. Location=NewPoint ( A+cursor.position.x-curx,341); } } #endregion Private voidPanel2_mousedown (Objectsender, MouseEventArgs e) {MouseDown=true; CurX=cursor.position.x; } Private voidPanel2_mouseup (Objectsender, MouseEventArgs e) { if(Cursor.position.x-curx <- -) {Panel2. Location=NewPoint (-286,0); Panel4. Location=NewPoint (0,0); } Else{Panel2. Location=NewPoint (0,0); Panel4. Location=NewPoint (286,0); } MouseDown=false; } Private voidPanel2_mousemove (Objectsender, MouseEventArgs e) { if(MouseDown) {Panel2. Location=NewPoint (0+cursor.position.x-curx,0); Panel4. Location=NewPoint (286+ Cursor.position.x-curx,0); } } Private voidPanel4_mousedown (Objectsender, MouseEventArgs e) {MouseDown=true; CurX=cursor.position.x; } Private voidPanel4_mouseup (Objectsender, MouseEventArgs e) { if(Cursor.position.x-curx > -) {Panel2. Location=NewPoint (0,0); Panel4. Location=NewPoint (289,0); } Else{Panel2. Location=NewPoint (-286,0); Panel4. Location=NewPoint (0,0); } MouseDown=false; } Private voidPanel4_mousemove (Objectsender, MouseEventArgs e) { if(MouseDown) {Panel2. Location=NewPoint (-286+ Cursor.position.x-curx,0); Panel4. Location=NewPoint (0+ Cursor.position.x-curx,0); } }
Mobile Phone slide Unlock code