Focus Rect on a CButton
-
Hi, I've create a very little bitmap button (that class is derived from CButton) and I don't want it draw a focus rect. In fact the focus Rect is draw over the bitmap and my button is so small that we are unable to understand it so if you find a way to remove it, tell me please thanks Remi Morin Rmorin@Operamail.com Remi.Morin@Lyrtech.com
-
Hi, I've create a very little bitmap button (that class is derived from CButton) and I don't want it draw a focus rect. In fact the focus Rect is draw over the bitmap and my button is so small that we are unable to understand it so if you find a way to remove it, tell me please thanks Remi Morin Rmorin@Operamail.com Remi.Morin@Lyrtech.com
You need to override the DrawItem function to handle your own drawing. There are many owner-drawn buttons that have bitmap support here already, e.g. CButtonSSL, which I wrote ;) It would only take a few small changes to prevent the focus rectangle being drawn (just comment out the call to
DrawFocusRect
). Derek Lakin. Salamander Software Ltd. -
You need to override the DrawItem function to handle your own drawing. There are many owner-drawn buttons that have bitmap support here already, e.g. CButtonSSL, which I wrote ;) It would only take a few small changes to prevent the focus rectangle being drawn (just comment out the call to
DrawFocusRect
). Derek Lakin. Salamander Software Ltd.Hi thanks for the tips but it's a big implementation for something so simple. I did'nt find what I'm searching for but I will. This is for a commercial application, in fact a application that we sold whit hardware, but this application will need modification/update very often, the reason why I'm doing it now (and i'm not using the old one) it's because modification/update are too hard. So I want to minimize the code. I'm doing a scroll bar derived from CWnd to get strange functionality, and I'm doing the little arrow at each end of my scroll bar. For these button, I don't want any Focus rect, everything else work already very well whitout so much code. So I don't want add a big button class when CButton do already the job very well, except for that f*** focus rect. Remi Morin Rmorin@Operamail.com Remi.Morin@Lyrtech.com