Sign in to follow this  
slack

[.net] Custom listview/scrollbar

Recommended Posts

slack    184
I'm trying to customize the colors and padding for a listview with tiled items. Unfortunately, the colors of listview and scrollbar are pretty much hard coded, so the only solution I see is to use completely new components. So, does anyone know of a custom listview (or possibly similar control for just tiled items) or a custom scrollbar? Thanks!

Share this post


Link to post
Share on other sites
slack    184
That's kinda what I'm trying to avoid. Also, there does not seem to be access to the scrollbar(s) associated with a listview, so those could not be drawn or created differently. If I can't find anything, I'll have to create my own simplified tiled list view control and a scrollbar control.

I really wonder why these controls have so little flexibility when it comes to customizing appearance. Some of the newer controls allow a Renderer object to be assigned, so I guess it's just the way the MFC controls are designed that WinForms builds on.

Share this post


Link to post
Share on other sites
dalep    331
Why do you want to avoid it? That's how custom apperances are done.

The scrollbar in a listview is accessible as a child window of the control. Get its HWND and you can get its WinProc and hook its paint events from there. A hassle, really. I'm not sure it wouldn't be less work to write a list view/scrollbar from scratch that paint the way you want them to.

Share this post


Link to post
Share on other sites
slack    184
I'd prefer to avoid writing my own customized list view or scrollbar if there are components already out there that have the functionality I'm after. I'd rather not deal with drawing, selection, tooltip, etc code. At the very least, I wanted to change the color of a group title in a listview. Seems that it can't be changed! Forecolor certainly doesn't work.

Ah well, guess I'll just go ahead and write my own controls.

Share this post


Link to post
Share on other sites
//** The scrollbar in a listview is accessible as a child window of the control. Get its HWND and you can get its WinProc and hook its paint events from there. **//

Is it possible to have an example of code? My point would be to have a larger horizontal / vertical scrollbar on a listview.

Thanks
Nico

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this