Thread: Moving a frame

  1. #1
    Registered User
    Join Date
    Jun 2005

    Moving a frame(sorry i mean groupbox)

    I'm trying to get this to work:

    When the user clicks the command button. I want it to put the groupbox's y coordinate into a variable.
    This is what I tried. y = frame1.location.Y;

    Then I want to move it. So I tried y+=20;

    THen I try to put it back into the frame so that it will change. frame1.Location.Y = y;

    But it doesn't work. Anyone have any idea ?.. when the user clicks the button..i want it to keep moving down or up.

    Thanks, Tperry.
    Last edited by Tperry23; 09-23-2005 at 02:40 PM.

  2. #2
    Banned nickname_changed's Avatar
    Join Date
    Feb 2003
    The problem is you probably can't assign to
    directly. Try this:

    int y = frame1.Location.Y;
    int y += 20;
    frame1.Location = new Point(frame1.Location.X, y);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Frame buffer not working
    By Noise in forum Game Programming
    Replies: 1
    Last Post: 02-15-2009, 12:05 PM
  2. Moving Average Question
    By GCNDoug in forum C Programming
    Replies: 4
    Last Post: 04-23-2007, 11:05 PM
  3. 3D moving
    By bluehead in forum C++ Programming
    Replies: 9
    Last Post: 04-02-2005, 05:46 AM
  4. Animation not working....
    By aquinn in forum C Programming
    Replies: 7
    Last Post: 02-19-2005, 05:37 AM
  5. the effects of textures on my frame rate
    By DavidP in forum Game Programming
    Replies: 37
    Last Post: 10-03-2003, 11:24 AM