- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using in my CVF program a Win32-driven dialog window. This window contains some ownerdrawn buttons. These buttons are painted in a background color by the program.
A button click will activate a "choosecolor"-dialog window to select a color. After selection the button should be painted in the selected color
My problem is now that the redraw of the button is not done directly. When I do a mouseclick somewhere in the window the redraw is done. But which function should be called to redraw the buttons without mouse activation?
Guus.
A button click will activate a "choosecolor"-dialog window to select a color. After selection the button should be painted in the selected color
My problem is now that the redraw of the button is not done directly. When I do a mouseclick somewhere in the window the redraw is done. But which function should be called to redraw the buttons without mouse activation?
Guus.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try
or, if it doesn't work, invalidate entire dialog (hDlg) instead of just that button.
iDummy = InvalidateRect(GetDlgItem(hDlg, IDC_MYBUTTON), NULL_RECTANGLE) iDummy = UpdateWindow(GetDlgItem(hDlg, IDC_MYBUTTON))
or, if it doesn't work, invalidate entire dialog (hDlg) instead of just that button.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With some adaptations to the call to InvalidateRect, it works for both a single button or the whole window.
I use: iDummy = Invalidaterect(GetDlgItem(hDlg, IDC_MYBUTTON), null_rect, .true. ).
I could not find the symbol NULL_RECTANGLE, but module dfwinty contains the pointer null_rect. Though I could not find an initialization of null_rect, it works and I hope it remains working. There is further a third argument bErase for InvalidateRect which indicates wether the background should be erased or not before updating the rectangle.
I was searching for a long time for a solution, but it appears again that this forum was very helpful.
Jugoslav, thanks for the help.
Guus.
I use: iDummy = Invalidaterect(GetDlgItem(hDlg, IDC_MYBUTTON), null_rect, .true. ).
I could not find the symbol NULL_RECTANGLE, but module dfwinty contains the pointer null_rect. Though I could not find an initialization of null_rect, it works and I hope it remains working. There is further a third argument bErase for InvalidateRect which indicates wether the background should be erased or not before updating the rectangle.
I was searching for a long time for a solution, but it appears again that this forum was very helpful.
Jugoslav, thanks for the help.
Guus.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page