Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 73655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:14:08+00:00 2026-05-10T20:14:08+00:00

When I enable common control visual style support (InitCommonControls()) and I am using any

  • 0

When I enable common control visual style support (InitCommonControls()) and I am using any theme other then Windows Classic Theme, buttons inside a group box appear with a black border with square corners.

Windows Classic Theme appears normal, as well as when I turn off visual styling.

I am using the following code:

group_box = CreateWindow(TEXT('BUTTON'), TEXT('BS_GROUPBOX'),      WS_CHILD | WS_VISIBLE | BS_GROUPBOX | WS_GROUP,     10, 10, 200, 300,     hwnd, NULL, hInstance, 0);  push_button = CreateWindow(TEXT('BUTTON'), TEXT('BS_PUSHBUTTON'),     WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,     40, 40, 100, 22,     group_box, NULL, hInstance, 0); 

EDIT: The issue occurs with radio buttons as well

EDIT: I am not using any dialogs/resources, only CreateWindow/Ex.

I am compiling under Visual C++ 2008 Express SP1, with a generic manifest file

Screenshot http://img.ispankcode.com/black_border_issue.png

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T20:14:09+00:00Added an answer on May 10, 2026 at 8:14 pm

    The problem is having the groupbox as the controls’ parent. Groupboxes are not supposed to have any children and using them as parents will cause all kinds of errors (including painting, keyboard navigation and message propagation). Just change the parent in the buttons’ CreateWindow call from group_box to hwnd (i.e. the dialog).

    I’m guessing you used the groupbox as the parent in order to position the other controls easily inside it. The proper way to do this is to get the position of the groupbox client area and map it to the client area of the dialog. Everything placed in the resulting RECT will then appear inside the groupbox. Since groupboxes don’t actually have a client area, it can be calculated with something like this:

    // Calculate the client area of a dialog that corresponds to the perceived // client area of a groupbox control. An extra padding in dialog units can // be specified (preferably in multiples of 4). // RECT getClientAreaInGroupBox(HWND dlg, int id, int padding = 0) {     HWND group = GetDlgItem(dlg, id);     RECT rc;     GetWindowRect(group, &rc);     MapWindowPoints(0, dlg, (POINT*)&rc, 2);      // Note that the top DUs should be 9 to completely avoid overlapping the     // groupbox label, but 8 is used instead for better alignment on a 4x4     // design grid.     RECT border = { 4, 8, 4, 4 };     OffsetRect(&border, padding, padding);     MapDialogRect(dlg, &border);      rc.left += border.left;     rc.right -= border.right;     rc.top += border.top;     rc.bottom -= border.bottom;     return rc; } 

    Note that the same applies to Tab controls. They too are not designed to be parents and will exhibit similar behavior.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 124k
  • Answers 124k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Are you running on OS 3.0? I saw the same… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer It looks like you need to register Apache::Session::Memcached with Apache::Session::Wrapper,… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer Use DATENAME or DATEPART: SELECT DATENAME(dw,GETDATE()) -- Friday SELECT DATEPART(dw,GETDATE())… May 12, 2026 at 1:19 am

Related Questions

Part of my everyday work is maintaining and extending legacy VB6 applications. A common
Basically, I want this: <select size=2> <option>1</option> <option>2</option> <option>3</option> <option>4</option> </select> But instead of
IIS enables us to also configure Asp.Net file mappings. Thus besides aspx, IIS also
I really need your help in my issue very quickly and it's too close

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.