Reset label location

This is a discussion on Reset label location within the C# Programming forums, part of the General Programming Boards category; I have a simple label control which I am using to graphically represent some water which decreases with each iteration ...

  1. #1
    Registered User verbity's Avatar
    Join Date
    Nov 2006
    Posts
    101

    Reset label location

    I have a simple label control which I am using to graphically represent some water which decreases with each iteration of a while loop. I need to relocate the label after a decrease in height. Because otherwise my water looks like it is defying gravity and decreasing in a upward direction....not downward.

    I tried the following:

    Code:
    waterLabel.Location.X = 100;
    waterLabel.Location.Y = 85;
    that was the original location of the water. But it gives me an error saying that Location is not a variable. I thought of maybe adding a set function but because of the "Location.X" I dont' really know how to work that. Could someone give me a few hints?? I realize it's dumb to use the label control for graphics but it's what I've been assigned to do....don't blame it on me.

    Thanks for any help.

    John.

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Code:
    waterLabel.Location = new System.Drawing.Point(100, 85);
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Label within a label?
    By Manaxter in forum C# Programming
    Replies: 0
    Last Post: 11-04-2006, 09:49 AM
  2. instantiated from here: errors...
    By advocation in forum C++ Programming
    Replies: 5
    Last Post: 03-27-2005, 09:01 AM
  3. I need help with templates!
    By advocation in forum C++ Programming
    Replies: 6
    Last Post: 03-26-2005, 09:27 PM
  4. Wierd Segmentation Faults on Global Variable
    By cbranje in forum C Programming
    Replies: 6
    Last Post: 02-19-2005, 12:25 PM
  5. Im so lost at . .
    By hermit in forum C Programming
    Replies: 18
    Last Post: 05-15-2002, 02:26 AM

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