ame1011 Posted February 6, 2008 Share Posted February 6, 2008 Is this possible? A search yielded no results. [font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font] Link to comment Share on other sites More sharing options...
Swift Posted February 6, 2008 Share Posted February 6, 2008 GUICtrlSetBkColor() GUICtrlSetColor() .... Link to comment Share on other sites More sharing options...
ame1011 Posted February 6, 2008 Author Share Posted February 6, 2008 GUICtrlSetBkColor() works to set the BK color of the control and I've already done that. What I want is to change the grey font to a pure black in a disabled control, which GUICtrlSetColor() doesn't accomplish. [font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font] Link to comment Share on other sites More sharing options...
Siao Posted February 6, 2008 Share Posted February 6, 2008 (edited) Does the edit control have to be disabled? You can use $ES_READONLY style. Otherwise might as well just use label control instead. Edited February 6, 2008 by Siao "be smart, drink your wine" Link to comment Share on other sites More sharing options...
ame1011 Posted February 7, 2008 Author Share Posted February 7, 2008 Yeah I Need it to be disabled =/. Readonly allows mouse clicks and selects the text inside the box if there is text, something I cannot have. I want my inputbox to have the exact same functionality as a disabled control but with pure black text. Any Ideas? [font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font] Link to comment Share on other sites More sharing options...
Siao Posted February 7, 2008 Share Posted February 7, 2008 (edited) Problem with disabled edit is that for whatever reason M$ decided to hardcode the color of text to use system COLOR_GRAYTEXT, so it's not possible to set the text color using WM_CTLCOLOREDIT/WM_CTLCOLORSTATIC for disabled, even though it works fine for enabled/readonly, and even though setting background color via these messages works just fine in all cases. Not that surprising I guess, Microsoft have a history of doing things in ways that don't make sense. Point is, this makes what you want rather complicated to do. In any case, it would require subclassing edit control, and either do the painting yourself on a disabled, or use readonly style like I suggested and simply intercept mouse/focus messages to prevent user clicking/selecting... So, like I said, consider using different control. Label, or if you have lot of information to show and need scrolling, a listbox with $LBS_NOSEL style... although seeing as you want to use disabled edit, which doesn't have scrolling ability, I guess that's not the case. So like I said, why simple label is not enough? Edited February 7, 2008 by Siao "be smart, drink your wine" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now