Moving a frame

This is a discussion on Moving a frame within the C# Programming forums, part of the General Programming Boards category; I'm trying to get this to work: When the user clicks the command button. I want it to put the ...

  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    11

    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
    Location
    Australia
    Posts
    986
    The problem is you probably can't assign to
    frame1.Location.Y
    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, 11:05 AM
  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, 04:46 AM
  4. Animation not working....
    By aquinn in forum C Programming
    Replies: 7
    Last Post: 02-19-2005, 04: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21