[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 712
  • Last Modified:

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 ?
0
IBRAHIM_AYGUN
Asked:
IBRAHIM_AYGUN
  • 2
2 Solutions
 
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
 
psasikCommented:
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
 
williamcampbellCommented:
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

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now