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

Posted on 2009-02-19
Last Modified: 2013-12-17
Is that all i want NUDGE the screen like in the Windows Live Messenger with C# .
Is that possible ?
    LVL 6

    Expert Comment

    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.
    LVL 6

    Accepted Solution

    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.

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

    Open in new window

    LVL 12

    Assisted Solution

    You can flash the window ...


      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.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now