Archived

This topic is now archived and is closed to further replies.

how to make custom looking win32 controls?

This topic is 4930 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all. firstly, i''m talking in cpp, and !!!NO MFC!!! I''ve figured out about all the "OwnerDraw" styles with most controls, which gives enough power for my needs except for one control, the EDIT class. it seems that I have absolutely NO control over how it looks when I create it with CreateWindow()... how can I customize the way my edit controls look? or is there a better way than using all the *_OWNERDRAW style options with CreateWindow()? thanks in advance. - StiNKy

Share this post


Link to post
Share on other sites
It depends on each control. For whatever reason, some controls allow you to change a fair bit and some don''t. In my experience, I''ve found that whenever you want a control that looks dramatically different it''s often easier to just create a new control from scratch by simply creating a blank window and handling all the drawing/input yourself.

That being said, doing an Edit control from scratch might be a lot of work

-John

Share this post


Link to post
Share on other sites
I’ve ran into this problem so many damn times. The EDIT control really sucks! It won’t let you do any customizing hardly. So I feel you pain on that one.

Try using the Rich Edit control. It is a lot more powerful then EDIT. Or maybe you can try to learn how a Rich Edit control works, then try to implement your own version of it using what you’ve learned.

MSDN Description:
A rich edit control is a window in which the user can enter, edit, format, print, and save text. The text can be assigned character and paragraph formatting, and can include embedded COM objects. Rich edit controls support almost all of the messages and notification messages used with multiline edit controls. Thus, applications that already use edit controls can be easily changed to use rich edit controls. Additional messages and notifications enable applications to access the functionality unique to rich edit controls. Beginning with Rich Edit 2.0, there is also single line or multiline capabilities and plain or rich text.

I found this in MSDN by researching CreateWindow( ). The description of the functions’ parameters shows a small list of classes that may be used. Among these, is the Rich Edit system class. In the description of the Rich Edit class are several links to information about it (i.e. Rich Edit Controls, Rich Edit Control Styles).

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Not sure I agree with the other posts. What exactly would you like to modify on the EDIT control?

I just started using it for my program, and while I''m running into a few problems with the redraw methods, I haven''t had any limitations on the EDIT controls'' physical characteristics. You can modify foreground color, background color, fonts, etc... and can even draw over their hDC. Combined with some messages like EM_CHARFROMPOS or EM_GETTHUMB you can learn a lot about the users interaction with the object. Of course, the rich edit control has tons more options that don''t need specialized programming to put them into action, but is that really what you need?

-Oskard
oskardNO@wpiSPAM.edu

Share this post


Link to post
Share on other sites