As we all know, winform provides the form jitter function in current instant messaging tools. This function is also set up to notify the other party in a timely manner, today, we will use the C # version of winform to implement the form mixing function!
Train of Thought: after a certain period of time, the position of the form must be changed around the starting position; otherwise, the form will be moved.
The Code is as follows:
UsingSystem;
UsingSystem. drawing;
UsingSystem. Windows. forms;
NamespaceTwitter
{
PublicPartialClassForm1
: Form
{
PublicForm1 ()
{
Initializecomponent ();
}
PrivateVoidButton#click (ObjectSender,
Eventargs E)
{
Random ran=NewRandom ((INT) datetime. Now. ticks );
Point point=This. location;
For(IntI=0;
I<40;
I ++)
{
This. Location=NewPoint (point. x+Ran. Next (8)-4,
Point. Y+Ran. Next (8)-4 );
System. Threading. thread. Sleep (15 );
This. Location=Point;
System. Threading. thread. Sleep (15 );
}
}
}
}