Remove Tab from optiondialog

Remove Tab from optiondialog

Anonymous
Not applicable
382 Views
1 Reply
Message 1 of 2

Remove Tab from optiondialog

Anonymous
Not applicable

Hi,

 

is there a way to remove tabs from the optiondialog?. I know the way to add, but not to remove.

 

Thanks

 

Jürgen

0 Likes
383 Views
1 Reply
Reply (1)
Message 2 of 2

norman.yuan
Mentor
Mentor

Let me give it a try on this unanswered question.

 

The custom tab to the "Options" dialog is added to the "Option" dialog by handling Application.DispalyOptionDialog event. That is, it is up to your code to deside whether you want to show custom tab(s) or not.

 

It is very likely in the DisplayingOptionDialog event nahdler that you have code like:

 

TabbedDialogExtension ext=new TabbedDialogExtension(...);

e.AddTab(ext);

 

As you can see, you never need to REMOVE a tab. You just add or does not add your own tab.

 

So, you could create a static variable of boolean type in your addin (for example, a variable named as "showMyTab"), which can be toggled with user input. Then you can do this in the DisplayOptionDialogevent handler:

 

if (showMyTab)

{

    TabbedDialogExtension ext=new TabbedDialogExtension(...);

    e.AddTab(ext);

}

 

This way, when the Option dialog shows, the custom tab would only be there when the variable "showMyTab" is set to True.

 

If you can persists the variable and restore its value in next AutoCAD session, the the custom tab would be shown in the user's preference.

 

HTH

Norman Yuan

Drive CAD With Code

EESignature

0 Likes