Thread: Window without 3D border

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    162

    Window without 3D border

    Hello

    I cant find a correct style which would make the child window without 3D border

    For e.g. I use now

    Code:
    WS_CHILD | WS_VISIBLE | BS_RADIOBUTTON,
    Which style makes it flat?

    Thanks in advance

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Assuming you're creating a button, there's BS_FLAT.

    gg

  3. #3
    Registered User
    Join Date
    Apr 2007
    Posts
    162
    Yes I tried that before but it changes only the button... In my case Radiobutton or checkbox. The child window remains with 3D border

  4. #4
    Registered User
    Join Date
    Dec 2007
    Posts
    214
    I'm confused. If the window style contains BS_RADIOBUTTON and the BS_FLAT style makes button flat, what other child window are you referring to? Maybe a bit more code would help.

  5. #5
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    968
    HWND hwnd;

    hwnd = CreateWindowEx(
    WS_EX_CLIENTEDGE,
    g_szClassName,
    "The title of my window",
    WS_OVERLAPPEDWINDOW,
    CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,
    NULL, NULL, hInstance, NULL);

    The first parameter (WS_EX_CLIENTEDGE) is the extended windows style, in this case I have set it to give it a sunken inner border around the window. Set it to 0 if you'd like to see the difference. Also play with other values to see what they do.
    Sometimes I forget what I am doing when I enter a room, actually, quite often.

  6. #6
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    You can remove styles by using a boolean AND.

  7. #7
    Registered User
    Join Date
    Apr 2007
    Posts
    162
    Quote Originally Posted by Shamino View Post
    HWND hwnd;

    hwnd = CreateWindowEx(
    WS_EX_CLIENTEDGE,
    g_szClassName,
    "The title of my window",
    WS_OVERLAPPEDWINDOW,
    CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,
    NULL, NULL, hInstance, NULL);

    The first parameter (WS_EX_CLIENTEDGE) is the extended windows style, in this case I have set it to give it a sunken inner border around the window. Set it to 0 if you'd like to see the difference. Also play with other values to see what they do.
    Thank you... Works well

    Just for record:

    Code:
    hWnd_Radio = CreateWindowEx(0,
    		TEXT("BUTTON"),
    		TEXT(""),
    		WS_CHILD | WS_VISIBLE | BS_RADIOBUTTON,
    		485, 375, 16, 16,
    		hWnd,
    		NULL,
    		hInstance,
    		NULL);
    	if ( hWnd_Radio == NULL )
    		return FALSE;

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  3. Pong is completed!!!
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 05-26-2005, 10:50 AM
  4. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  5. problem with open gl engine.
    By gell10 in forum Game Programming
    Replies: 1
    Last Post: 08-21-2003, 04:10 AM