How do I change Toggle-Buttons only in the active Inspector

Add-in Express™ Support Service
That's what is more important than anything else

How do I change Toggle-Buttons only in the active Inspector
 
mio


Guest


Hi,

i am trying to create an Outlook-Addin for Outlook 2010 and 2003 which has two toggle-buttons in the Inspector-Window. The toggle states are initially loaded from the windows registry.

The toggle states of the buttons are interconnected in the following way:
If Button 1 is not pressed Button 2 must also not be pressed
If Button 2 is pressed Button 1 has to be pressed
Button 1 can be active by itself

The problem I now have is that when the user has 2 or more inspectors open at the same time the changes performed in one inspector is also done to the buttons in the other inspectors. Also opening a new Inspector overwrites the changes done in the previous open inspectors.

1. Is there a way to restrict changes done to the Toggle-Buttons only to the Buttons in the Active Inspector?

2. Is there a way to identify the current Instance of the control, if there is an instance of the control per inspector?

Thans for the help

Best regards
Fabian
Posted 24 Feb, 2012 09:12:18 Top
Eugene Astafiev


Guest


Hi Fabian,

Sure. In case of command bars please use the InspectorActivate event for updating your controls. But if you use Outlook 2007 and above the Ribbon UI is used instead. Note, the Ribbon UI is static thing from its birth. You can read more about this in the http://msdn.microsoft.com/en-us/library/aa338202%28v=office.12%29.aspx article in MSDN. A possible dynamism in the Ribbon UI is to use the PropertyChanging event of the ribbon controls (also known as ribbon callbacks). For example:

private void adxRibbonTab1_PropertyChanging(object sender, ADXRibbonPropertyChangingEventArgs e) 
{ 
    if (e.PropertyType == ADXRibbonControlPropertyType.Visible) 
    { 
        e.Value = false; // hide  
    } 
} 


Please read more about this in the http://www.add-in-express.com/docs/net-ribbon-components.php#properties-events section of the online documentation. Finally, you can find a lot forum threads on this, for example:

http://www.add-in-express.com/forum/read.php?SHOWALL_1=1&FID=5&TID=8473#nav_start
http://www.add-in-express.com/forum/read.php?FID=5&TID=9899
http://www.add-in-express.com/forum/read.php?FID=5&TID=10293
http://www.add-in-express.com/forum/read.php?FID=5&TID=5128
Posted 24 Feb, 2012 13:52:01 Top