Skip to main content
GameDev.net gamedev.net
🔒 Locked

Edit control owner draw sample?

Started by antareus May 2, 2004 at 12:42 PM 4 replies 7.1k views
Original Post
antareus
antareus
I''m looking for a sample of a Win32 owner draw edit control. Google doesn''t return much of use, and the Scintilla control is huge and tailored towards code editing. I''m just looking to apply some basic formatting to it, such as bold, underline, strikeout, font changing, and picture embedding. I know mIRC and countless text editors do it by drawing all the text themselves, but most of the code samples on the net are centered towards owner drawing portions of treeviews/comboboxes. I can''t use a richedit control because I need to be able to paint the background all the way to the edge of the control, not just behind text.
--God has paid us the intolerable compliment of loving us, in the deepest, most tragic, most inexorable sense.- C.S. Lewis
Aprosenf
Aprosenf
This isn''t exactly what you''re looking for, but it''s close. It shows how to draw an owner-drawn button. It was the first hit I got on Google for "owner drawn edit control" so you just need to use the right search terms. Here''s another article on owner-drawn buttons from MSDN. After looking through MSDN, I''m not sure edit controls can be owner drawn. There''s no ES_OWNERDRAW style (whereas there''s a BS_OWNERDRAW style for buttons). I''ll keep looking.
antareus
antareus
Yeah, you can''t owner draw edit controls, the title is a bit of a misnomer.

I basically need to TextOut into a window and bestow edit-control like semantics on it, but that scares me, frankly.
--God has paid us the intolerable compliment of loving us, in the deepest, most tragic, most inexorable sense.- C.S. Lewis
LessBread
LessBread
Subclass a static window. Get the hdc from it and draw on that.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
antareus
antareus
Perfect, thank you.
--God has paid us the intolerable compliment of loving us, in the deepest, most tragic, most inexorable sense.- C.S. Lewis

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.