- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all!
I have a ribbon panel editor to show/hide ribbon tabs within an in-house addin, we have lots of other paid tools and the ribbon is really ful. I noticed I'd have duplicate version for the family based panels in a regular window.
To remove the duplicates I did:
if (!ribbonCheckboxList.Items.Contains(tab.Title))
{
ribbonCheckboxList.Items.Add(tab.Title);
}
When this list is built, the duplicates are removed, however the effect is present on both with the same name, as I do the following:
string CurrentlySelectedTab = (string)ribbonCheckboxList.Items[e.Index];
if (sdsstring != CurrentlySelectedTab.ToLower())
{
foreach (RibbonTab tab in Autodesk.Windows.ComponentManager.Ribbon.Tabs)
{
Debug.WriteLine(tab.Title);
if ((CurrentlySelectedTab == tab.Title) && (e.CurrentValue == CheckState.Checked))
{
tab.IsVisible = false;
}
if ((CurrentlySelectedTab == tab.Title) && (e.CurrentValue == CheckState.Unchecked))
{
tab.IsVisible = true;
}
}
}
A simple on or off when clicked and everything works.
Now as it searches for Title, both panels are added or removed, resulting in this, duplicate versions. This is my error I'd like to fix:
Is there a way of detecting the family versions of the panels or should I be storing the tab.UID property instead? Obviously this would assume the first iteration of the "Annotate" panel is the "normal" one correct? I'd prefer to have a detection for family based as this would require it working in the family version as well.
Solved! Go to Solution.