M
Michael J. Salamone
I have some strange behavior with toolbar images - will do my best to
describe - hope someone can help!
I have several toolbars in my application. I assign each toolbar button an
image at design time - and they all display correctly in the designer.
However, when I run the program, some toolbar images are displayed, and
others are "blank" - no image displayed. The tooltips do display, though.
On each toolbar, either all the images are displayed correctly, or all are
blank.
The main form has several tabs. Each tab has associated listviews,
treeviews, etc - and toolbars. When the app starts, there is code to
restore splitters and column widths settings for each listview.
On the particular tab that has the problem, the preferences are restored
after the call to InitializeComponent(). If, immediately after the call to
restore preferences I add a message box, all the toolbar images are
displayed correctly. Without even changing the code - just breaking on the
call to MessageBox, and then setting the instruction pointer immediately
after it - no toolbar images If I execute the MessageBox statement -
voila - toolbar images!
It's a bit bizarre, and I'm not sure where to go with it. I'd appreciate
any suggestions on things to check, a good strategy to debug, or even just a
way to narrow down the problem!
This is how the code goes:
InitializeComponent();
EnableDisableControls(); // disables or enables controls - including
toolbars
RestorePreferences(); // restore listview column widths, splitters
MessageBox();
I've tried skipping both EnableDisableControls and RestorePreferences
calls - to no avail. It's the call to MessageBox() that seems to be the
magic bullet.
describe - hope someone can help!
I have several toolbars in my application. I assign each toolbar button an
image at design time - and they all display correctly in the designer.
However, when I run the program, some toolbar images are displayed, and
others are "blank" - no image displayed. The tooltips do display, though.
On each toolbar, either all the images are displayed correctly, or all are
blank.
The main form has several tabs. Each tab has associated listviews,
treeviews, etc - and toolbars. When the app starts, there is code to
restore splitters and column widths settings for each listview.
On the particular tab that has the problem, the preferences are restored
after the call to InitializeComponent(). If, immediately after the call to
restore preferences I add a message box, all the toolbar images are
displayed correctly. Without even changing the code - just breaking on the
call to MessageBox, and then setting the instruction pointer immediately
after it - no toolbar images If I execute the MessageBox statement -
voila - toolbar images!
It's a bit bizarre, and I'm not sure where to go with it. I'd appreciate
any suggestions on things to check, a good strategy to debug, or even just a
way to narrow down the problem!
This is how the code goes:
InitializeComponent();
EnableDisableControls(); // disables or enables controls - including
toolbars
RestorePreferences(); // restore listview column widths, splitters
MessageBox();
I've tried skipping both EnableDisableControls and RestorePreferences
calls - to no avail. It's the call to MessageBox() that seems to be the
magic bullet.