M
Michael R
I have created ComandBarButton objects and I store them in an ArrayList to
keep the Event handler in scope. I would like to set the Visible property
on these objects and thought I could call each ( via an index into the
ArrayList) and set the property. But when I attempt to access any of the
buttons I get the exception: Exception from HRESULT: 0x800A01A8
Any ideas?? Thanks.
basic code:
CommandBarButton oCmdButton = (CommandBarButton)PopUp.Controls[MenuText];
//a valid CommandBarButton that allows me to set all properties
MenuStore.Add(oCmdButton);
....
CommandBarButton oBtn = (CommandBarButton)MenuStore[idx];
oBtn.Visible = true; //causes exception even though oBtn appears to be
valid. (Same reference as MenuStore[idx] which is the same reference as
when the button was created above.)
keep the Event handler in scope. I would like to set the Visible property
on these objects and thought I could call each ( via an index into the
ArrayList) and set the property. But when I attempt to access any of the
buttons I get the exception: Exception from HRESULT: 0x800A01A8
Any ideas?? Thanks.
basic code:
CommandBarButton oCmdButton = (CommandBarButton)PopUp.Controls[MenuText];
//a valid CommandBarButton that allows me to set all properties
MenuStore.Add(oCmdButton);
....
CommandBarButton oBtn = (CommandBarButton)MenuStore[idx];
oBtn.Visible = true; //causes exception even though oBtn appears to be
valid. (Same reference as MenuStore[idx] which is the same reference as
when the button was created above.)