Hello There,
I noticed this doesn''t work on MDI form. I attach a sample to you here. click File-->New, then click File-->Open, you can see it add up new baritems in without clear old ones. When you change the form to non-MDI form by changing the ISMDIForm property to false. It works.
This is a urgent issue for me. Please help me get around it. Thanks.
Lan
>Hello There,
>I used two XPMenu bars to display MainModule and SubModule menu items. I wrote following code to dynamically change the SubModule baritems when clicking on a MainModule item. In my code, I use
>''barSubModule.Items.Clear();'' to clear old baritems. But it doesn''t work. The old baritems is still displaying with the new baritem appended behind them. I guess I need some kind refresh or so.
>Any idea?
>Thanks,
>Lan
>
> private void ResetSelectedModule(BarItem SelectedBarItem)
> {
>
> //get the selected submodule bar
> Bar barCurr = this.barHomeCategory;
> switch (SelectedBarItem.ID)
> {
> case "Home":
> barCurr = this.barHomeCategory;
> break;
> case "Sections":
> barCurr = barSectionCategory;
> break;
> case "Reports":
> barCurr = barReportCategory;
> break;
> case "Parameters":
> barCurr = barParameterCategory;
> break;
> case "Analysis":
> barCurr = barAnalysisCategory;
> break;
> case "Utility":
> barCurr =barUtilityCategory;
> break;
> }
> //clear old submodule items
> barSubModule.Items.Clear();
> // add new submodule items
> for (int i=0;i
{
> barSubModule.Items.Add(barCurr.Items[i]);
> }
>
> }
>
Toolbar3.zip