Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    GroupBox Border (VS 2003)

    I'm trying to draw a border around a custom control that looks like a group box and I need to determine what color(s) to use. With a Windows Classic/Standard, a groupbox border is actually a two pixel white rectangle and a one pixel grey rectangle, but the actual RGB colors change slightly depending on what theme and background color you use. Is there any reference material on computing window component colors that anyone knows about? TIA --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: GroupBox Border (VS 2003)

    Why not use system colors, which will adapt themselves automatically to the current user palette? I believe the groupbox uses ActiveBorder for its border color and control for the backcolor.
    Charlotte

  3. #3
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: GroupBox Border (VS 2003)

    Why not indeed! I had never seen SystemColors, but just discovered them while reading the Help files (a rather poor way to learn .NET). I used SystemColors.ControlLightLight to draw a two pixel border and then SystemColors.ControlDark to overlay a single pixel border on top of that ( with a -1,-1 offset) and it looks just like a groupbox border. Thanks! --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •