CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2002
    Posts
    212

    CComboBox without the client edge?

    I am working on something similar to a grid control, and I have nearly all the cell types that I want, except for one. I can't get the CComboBox to fit in 16 pixels vertically, mainly because I can't make it lose the client edge it draws. I've tried ModifyStyleEx(WS_EX_CLIENTEDGE, 0) with no luck. I've looked on www.codeproject.com and codeguru without much luck. I found a control that looked like it might do it, but it just draws over the client edge area with a window colored rectangle, so that screws with neighboring cells. surely people have encountered this problem before?

  2. #2
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: CComboBox without the client edge?

    Combo box does not have WS_EX_CLIENTEDGE style. That is just a way combo draws itself.
    Look for owner drawn examples.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  3. #3
    Join Date
    May 2004
    Location
    Michigan, United States
    Posts
    457

    Re: CComboBox without the client edge?

    Quote Originally Posted by Kibble
    ... I can't get the CComboBox to fit in 16 pixels vertically...
    Remember that a combo box is actually two windows. Have you tried resizing the edit window within? I've done this in the past with a subclassed combobox and it worked for me.
    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

  4. #4
    Join Date
    Nov 2001
    Location
    Beyond Juslibol
    Posts
    1,688

    Re: CComboBox without the client edge?

    The only way I know to change the height of a combo box (I'm talking about the edit box) is to change the size of its font.

    As said JohnCz the client edge is by design, it is not a window style, and you can't remove it unless you use an ownerdraw combo box.

    Then the height of the edit box of the combo box will be the font height+the pixels of the client edge (I think they are 8 pixels)

    In order to change the width you can use either MoveWindow or SetWindowPos

  5. #5
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: CComboBox without the client edge?

    I wonder how did you do that?
    It would be really helpful to see code that you used.

    As far as I know, only changing a font size can change height of the combo.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  6. #6
    Join Date
    Aug 2002
    Posts
    212

    Re: CComboBox without the client edge?

    How do you access the edit control? This structure and related functions are undefined, I must have an old version of the SDK:

    http://msdn.microsoft.com/library/de...mboboxinfo.asp

  7. #7
    Join Date
    Aug 2002
    Posts
    212

    Re: CComboBox without the client edge?

    I updated my platform SDK, it works now, as well as a ton of other **** that I couldn't do before. Thanks for the help.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured