Announcement

Collapse
No announcement yet.

Transparent combobox?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Chris Boss
    replied
    Not all control classes can handle a transparent background.

    A lot has to do with how a control paints the background. Some paint it in the WM_ERASEBKGND message. Others appear to paint it in WM_PAINT.

    I don't think it is possible to have a transparent ComboBox.

    Also the Combobox uses child controls for part of itself. Depending upon the styles used, it can use a Static control or Edit control for the main part. The drop down list is not a listbox. It is a special window class called: COMBOLBOX

    That said, it may be possible to accomplish what you want with an ownerdraw combobox. If you get the coordinates of the client area of the control (in relation to the parent dialog), you could BitBlt a rectangular area out of the Bitmap at that location into the combobox background and then draw the text on top during the WM_DRAWITEM message.

    Leave a comment:


  • Egbert Zijlema
    replied
    I know, Roger

    Roger,

    I know that the dropdown part of a combobox is a listbox. But that's not what I want to color. I want the visible part (edit field) to come up as a transparent control.

    Leave a comment:


  • Roger Garstang
    replied
    To edit colors in a dropdown you have to consider it is a listbox, thus will need to process it in that message and check to see if the parent is a combo.

    Leave a comment:


  • Egbert Zijlema
    started a topic Transparent combobox?

    Transparent combobox?

    A dialog has a couple of labels plus a combobox. Using SetBkMode during WM_CTLCOLORSTATIC, it is not difficult to give the labels a transparent background, but the combobox appears to be another story. Yes, during WM_CTLCOLOREDIT I can change the text color and the background color of the combobox (the edit field, not the dropdown list), but SetBkMode does obviously not work here. Unfort. using SetBkColor is not really an option, because the background of my dialog is a bitmap, not a color. A forum search for "transparent combobox" did not match my needs.
Working...
X