Hello, in making a control I want to select an item, text, like in a list veiw control. You know when you click on a row, its background goes blue and the text goes white? How should I do that?

I thought that I could draw the blue rect on another bitmap with the same size as my backbuffer and somehow blt it onto the backbuffer. But, I doubt this is the best solution, and looking at the Blt flags I doubt I'll get the result I want...

Thanks for any suggestions,
Posted on 2004-06-22 14:42:16 by adamjjackson
FillRect is a good possibility, then you just have to define a background brush. Fill the background with the color you want then draw the text or graphic over that.
Posted on 2004-06-22 15:48:57 by donkey
Yeah thanks, it's just that if I have got my whole control drawn it seems a bit of a waste to redraw the whole thing. It's only a calendar so it isn't too much to draw, but if its full of events it does invole parsing the link list for each day I draw, so for example if a user clicks on an event on 22nd of june the whole thing has to be redrawn - parse the linked list 30times - once for each day cell drawn, just to get a blue background and white text on that one small section of the bitmap. Seems like overkill?
Posted on 2004-06-22 15:59:18 by adamjjackson
Ah ha! Just read a thread which mentions DrawFocusRect - I'll have a skeet at my api reference...
Posted on 2004-06-23 16:22:07 by adamjjackson