N
Neville Lang
Hi all,
I have a TabControl and on one of the Tab Pages I have a Panel control. On
the panel I create a bitmap image in background so that when the Tab Page is
selected, it displays the bitmap fast. Also, on the Panel, I have a Button
that I call ReDraw and its Click event is mapped to a handler. The handler
code redraws the image in background. The reason for this is that if a
setting in the App changes then a user can click the button to force a
redraw of the bitmap image to reflect the setting change. However, my
problem is that the image does not get updated no matter how many setting
changes are made. On the button's click handler, I have called various
Refresh() methods of the Panel, the Tab Page, the TabControl and even the
main Form but nothing seems to update the Bitmap image on the TabPage.
What I did find was that after I made an App setting change then I tapped
another Tab Page then tapped the original Tab Page with the Bitmap image, it
was redrawn correctly. I then coded the button's click handler to set the
TabControl.SelectedIndex to another tab then set it back again, and this
combination does force the Bitmap image to update.
This seems rather an awkward way to force a refresh. At present, there does
not seem to be any other way to refresh (redraw) a control sitting on a Tab
Page without setting/resetting the SelectedIndex of the TabControl. Is this
correct? Any ideas or workarounds to make this thing easier?
Regards,
Neville Lang
I have a TabControl and on one of the Tab Pages I have a Panel control. On
the panel I create a bitmap image in background so that when the Tab Page is
selected, it displays the bitmap fast. Also, on the Panel, I have a Button
that I call ReDraw and its Click event is mapped to a handler. The handler
code redraws the image in background. The reason for this is that if a
setting in the App changes then a user can click the button to force a
redraw of the bitmap image to reflect the setting change. However, my
problem is that the image does not get updated no matter how many setting
changes are made. On the button's click handler, I have called various
Refresh() methods of the Panel, the Tab Page, the TabControl and even the
main Form but nothing seems to update the Bitmap image on the TabPage.
What I did find was that after I made an App setting change then I tapped
another Tab Page then tapped the original Tab Page with the Bitmap image, it
was redrawn correctly. I then coded the button's click handler to set the
TabControl.SelectedIndex to another tab then set it back again, and this
combination does force the Bitmap image to update.
This seems rather an awkward way to force a refresh. At present, there does
not seem to be any other way to refresh (redraw) a control sitting on a Tab
Page without setting/resetting the SelectedIndex of the TabControl. Is this
correct? Any ideas or workarounds to make this thing easier?
Regards,
Neville Lang