text on a disabled combobox

G

Guest

Hi,

I need to make the text on a combobox that is disabled to be drawn with a
black color. I was not able to find any help on this online. The drawItem
seems to apply only for the dropdpwn items. Any ideas or sugesstions would be
appreciated.



Thank you,

Vish
 
M

Michael Nemtsev

Hello vish,

Unfortunately this is missed in .NET, till you draw control yourself

v> I need to make the text on a combobox that is disabled to be drawn
v> with a black color. I was not able to find any help on this online.
v> The drawItem seems to apply only for the dropdpwn items. Any ideas or
v> sugesstions would be appreciated.
v>
v> Thank you,
v>
v> Vish
v>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
G

Guest

Hi Michael,

Thanks for your reply. I have been trying to search more information on it
so that i can paint the control myself. Even there i had run into trouble.
The combobox OnPaint event paints only the border and the button portion of
the combobox. The textbox portion of the combobox was not accessible. So i
had to use Win32 functions to get an handle to the text box portion of the
combobox. But again the painting of the textbox portion of the combobox works
fine when the combobox is enabled but it does not work when the control is
disabled even though the OnPaint and the same code is getting executed. Any
ideas?

Thank You,
Vish
 
M

Michael Nemtsev

Hello vish,

try look for the answer here http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c88c.aspx#q547q
and here http://www.codeproject.com/cs/combobox/

v> Hi Michael,
v>
v> Thanks for your reply. I have been trying to search more information
v> on it so that i can paint the control myself. Even there i had run
v> into trouble. The combobox OnPaint event paints only the border and
v> the button portion of the combobox. The textbox portion of the
v> combobox was not accessible. So i had to use Win32 functions to get
v> an handle to the text box portion of the combobox. But again the
v> painting of the textbox portion of the combobox works fine when the
v> combobox is enabled but it does not work when the control is disabled
v> even though the OnPaint and the same code is getting executed. Any
v> ideas?
v>
v> Thank You,
v> Vish
v> "Michael Nemtsev" wrote:
v>---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
G

Guest

Hi Michael,

Thanks for your suggestions. I did look at both the links that you had sent
me. Unfortunately they did not solve my problem. The first link paints the
items in the drop down and not in the combobox itself.

Thank You,
Vish
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top