ListBox Question (non-MFC)
-
I have created a List box using CreateWindow in my app's client area. Is there any way I can make the background of my list box transparent so that it is the same color as the background of my main window? Thanks in advance, Paddy.
Get the handle to the device context of the listbox (HDC) and use the Win32 function
SetBkColor
to set the color you want. For more, see function SetBkColor in MSDN. If you would like to use the same color as in your main window, you first have to get the standard color of your window, which is usually done by a call to GetSysColor. Hope this helps, -Dominik -
Get the handle to the device context of the listbox (HDC) and use the Win32 function
SetBkColor
to set the color you want. For more, see function SetBkColor in MSDN. If you would like to use the same color as in your main window, you first have to get the standard color of your window, which is usually done by a call to GetSysColor. Hope this helps, -Dominikummm i don't believe that 'transparent' is the same as setting the background color to the same as the background window. Not to mention how do you know what window and what background color it is, and what about if it has something in it... or am I totaly lost?
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
-
Get the handle to the device context of the listbox (HDC) and use the Win32 function
SetBkColor
to set the color you want. For more, see function SetBkColor in MSDN. If you would like to use the same color as in your main window, you first have to get the standard color of your window, which is usually done by a call to GetSysColor. Hope this helps, -Dominik -
ummm i don't believe that 'transparent' is the same as setting the background color to the same as the background window. Not to mention how do you know what window and what background color it is, and what about if it has something in it... or am I totaly lost?
"No matter where you go, there your are..." - Buckaoo Banzi
-pete