Changing Control Properties At Run-Time

This is a discussion on Changing Control Properties At Run-Time within the Windows Programming forums, part of the Platform Specific Boards category; How can you change dialog control properties at runtime? Eg: I got a label on my dialog box and want ...

  1. #1
    Registered User SubLogic's Avatar
    Join Date
    Jan 2003
    Posts
    33

    Question Changing Control Properties At Run-Time

    How can you change dialog control properties at runtime? Eg: I got a label on my dialog box and want to change it's caption.
    Thanks.

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    Use the SetWindowText() API function.

    Post code if you need more help.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Registered User SubLogic's Avatar
    Join Date
    Jan 2003
    Posts
    33
    Not the Dialog's Caption, the Label.
    0100001

  4. #4
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    Right...then use SetWindowText() like he said. Or, alternatively, if it's a dialog, SetDlgItemText().

  5. #5
    Registered User SubLogic's Avatar
    Join Date
    Jan 2003
    Posts
    33
    What about other properties?
    0100001

  6. #6
    Registered User johnnie2's Avatar
    Join Date
    Aug 2001
    Posts
    186
    Use SetWindowLong() to set new extended window styles, regular window styles, a new window procedure, a new identifier, modify the 32-bit value in the window's extra memory space, etc.
    "Optimal decisions, once made, do not need to be changed." - Robert Sedgewick, Algorithms in C

  7. #7
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    >>> Post code if you need more help.

    Or be specific with your questions.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 02-29-2008, 01:29 PM
  2. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 06:49 PM
  3. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 10:44 AM
  4. Create class at run time
    By muaed in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 04-11-2002, 09:13 AM
  5. Changing the color of a control
    By Dharius in forum Windows Programming
    Replies: 2
    Last Post: 02-22-2002, 10:55 AM

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