.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Remove Tab from optiondialog

1 REPLY 1
Reply
Message 1 of 2
Anonymous
300 Views, 1 Reply

Remove Tab from optiondialog

Hi,

 

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

 

Thanks

 

Jürgen

1 REPLY 1
Message 2 of 2
norman.yuan
in reply to: Anonymous

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost