Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics


Themes!

Posted by benryves, 22 November 2005 · 151 views

Not the www2 theme though - a couple of XP theme glitches.

First up is the ListView control in .NET 2. If you switch on gridlines and scroll with the arrows on the scrollbar, it leaves the gridlines behind as nasty artefacts. This is what I came up with - and it appears to work.

Create a new class that inherits from ListView. Then add to it this code:

        /// <summary>
        /// Hacky override to fix the garbage lines.
        /// </summary>
        protected override void WndProc(ref Message m) {
            if (m.Msg == 0xF) { // 0xF is WM_PAINT
                GridLines = false;
                GridLines = true;
            }
            base.WndProc(ref m);
        }


...compile and that new class should appear in your toolbox. Use that instead of the normal ListView control.

If anyone could come up with a better solution, I'd love to hear it...

The other theme bug appeared last night in XP.


Click for big.


I guess it can't remember if it's using Windows Classic or Windows XP styling?




that xp bug looks really strange O_o

btw: have you seen this before: http://www.pouet.net/prod.php?which=17673 ?
I hate you and your crazy ass dual monitor system.

Oh, and remind me to get your to tell me what controls and stuff you used for your editor... Would be cool to make a script editor for a scripting engine type thingy thing thingy.....
@Rob: The control is just a modified RichTextBox. The original version was pretty buggy and very slow - I've removed the bugs, but it's still pretty slow (at least it now only rehighlights lines of text that have changed!)

@philipptr: It's a very nice demo [smile] (Looks great on hardware). He's managed to switch palette colours at the ends of scanlines, so has the timing down pretty tightly - not something I ever managed to get quite right!
PARTNERS