How Can I Nudge the Screen like in the MSN with C# ?

Is that all i want NUDGE the screen like in the Windows Live Messenger with C# .
Is that possible ?
IBRAHIM_AYGUNAsked:
Who is Participating?
 
psasikConnect With a Mentor Commented:
Ooops. i meant the Location property.

The code below can be inserted into any member function of the main form window (such as an event handler) and executed arbitrarily.

The example below simply "nudges" the screen to the right by 10 pixels.

Cheers.
Point p = this.Location;
p.X += 10;
this.Location = p;
  

Open in new window

0
 
psasikCommented:
Yes. All you have to do is change the Position property of the main window.  Of course, the new position should be calculated from the current position so that you do get a nudge and not some random move.
0
 
williamcampbellConnect With a Mentor Commented:
You can flash the window ...
http://blogs.x2line.com/al/archive/2008/04/19/3392.aspx

or

  something like this

  x = currentwindowxposition
  y = currentwindowyposition

  for (int i = 0; I < 100;  i++)
  {
       if ( i mod 2 )  MoveWindow ( x-12, y );
       Sleep ( 100 );
       if ( i mod 4 )  MoveWindow ( x-24, y );
       Sleep ( 100 );
       if ( i mod 8 )  MoveWindow ( x+12, y );
       Sleep ( 100 );
       if ( i mod 10 )  MoveWindow ( x-24, y );
  }
 
 MoveWindow ( x, y );

This will shake the window form side to side.


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.