Updating Labels on a Form

This is a discussion on Updating Labels on a Form within the C# Programming forums, part of the General Programming Boards category; Hi, I have a form that has about 200 labels on it, to display various bits of data. The form ...

  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    36

    Updating Labels on a Form

    Hi,

    I have a form that has about 200 labels on it, to display various bits of data. The form background is green, and the labels have a white background, with an alpha value of 100, to give a semi-transparent look. However, when the form loads, it updates each label individually from the appearance of the previous screen, taking about 10 seconds, and similarly whenever I move another window infront of this form and away again.

    This did not happen when the labels were opaque with alpha set at 255. Any ideas on why the refreshing is so slow? Thanks.

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,892
    Alpha composition is slow. That's just how it is.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,399
    If the labels are static, you might try creating a bitmap of your layout, loading it into a PictureBox, and using the PictureBox for all of your static elements.
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  4. #4
    Registered User
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    212
    Also try double buffering

  5. #5
    Registered User Frobozz's Avatar
    Join Date
    Dec 2002
    Posts
    546
    Alpha composition is slow since Windows XP is running the GUI through software (aka the CPU). Under Windows Vista I'd expect to see a big increase in rendering speed. Or at least it'll be as fast as when you are not using opacity.

    Edit: See! Windows Vista is actually good for something.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Calling datas from another form?
    By Aga^^ in forum C# Programming
    Replies: 2
    Last Post: 02-06-2009, 01:17 AM
  2. Storing labels in a list?
    By arcaine01 in forum C# Programming
    Replies: 2
    Last Post: 05-10-2008, 11:10 PM
  3. Accessing main form from functions in other classes
    By pj_martins in forum C++ Programming
    Replies: 1
    Last Post: 11-05-2004, 08:27 AM
  4. My UserControls dissapear off my form
    By zMan in forum C# Programming
    Replies: 2
    Last Post: 09-15-2004, 08:55 AM
  5. Making an MFC form to suit
    By TJJ in forum Windows Programming
    Replies: 1
    Last Post: 04-17-2004, 11:20 AM

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