Pretty UI in C#

E

Eric

I'm interested in creating a rich user interface in my Windows forms
applications that can be completely customized via GDI+. I've been able to
subclass controls such as the panel control, button, radio button, and
checkbox, but other form controls are frustrating to work with because some
of the behavior and presentation can't really be controlled entirely when
subclassing them. Specifically, does anyone know of a good place where
controls such as the treeview, listview, richtextbox, combobox, and
tabcontrol have been supplied with paint overriding effectively?



For example, I know of an excellent article on CodeProject that explains how
to generate missing paint events for treeview here:



http://www.codeproject.com/cs/miscctrl/genmissingpaintevent.asp?target=TREEVIEW|PAINT



I'm just looking for more sources. Two things I am having problems with is
generating paint events for richtext and drawing my own scrollbars. When you
customize the appearance of a control completely, the default scrollbar
seems really out of place.



Thanks so much in advance.
 
N

Niki Estner

To customize TreeView/Tabview/Listview paiting you have to override the
NM_CUSTOMDRAW notification. This is pretty advanced, since you need lots of
Win32 API structures - I'd probably use MC++ to implement these handlers.
For classic comboboxes overriding the MeasureItem/DrawItem methods should be
sufficient.

Maybe googling for these keywords helps.

Niki
 
B

Bob Powell [MVP]

In the March edition of Well Formed I explain how to fully customize drawing
of ListView using .NET. I provide two articles, the first on the simple
system of drawing only the detail view using built-in custom drawing. The
second article explains how to get the NM_CUSTOMDRAW notifications and shows
all the interop associated with it.

http://www.bobpowell.net/march2004.htm


--
Bob Powell [MVP]
Visual C#, System.Drawing

All you ever wanted to know about ListView custom drawing is in Well Formed.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*

The GDI+ FAQ: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://royo.is-a-geek.com/siteFeeder/GetFeed.aspx?FeedId=41

*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*
 

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