Hide TAdxRibbonTab on runtime

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

Hide TAdxRibbonTab on runtime
 
Nano




Posts: 3
Joined: 2010-07-13
Hi Guys

I'm using AddinExpress 2010 with Office 2010 and I have the following problem:
There's a TAdxRibbonTab on my TAddInModule.
On the event OnOLEExplorerFolderSwitch I enable/disable several buttons. If theres no button enabled, i would hide the RibbonTab. But my lovely RibbonTag wouldn't go away. Why couldn't the RibbonTab do the same as my ex-girlfriend: Disappear?

If i set visible to false on the component, it works, but if i set visible:=false on OnOLEExplorerFolderSwitch it doesn't work...

Can you help my?
Thank you very much

Nano
Posted 13 Jul, 2010 03:24:39 Top
Andrei Smolin


Add-in Express team


Posts: 18279
Joined: 2006-05-11
Hi Nano,

What value do you have in the Ribbons and IdMso properties of the TAdxRibbonTab?

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Jul, 2010 04:25:21 Top
Nano




Posts: 3
Joined: 2010-07-13
Thanks you for the fast answer.

On Ribbons I have this values: msrOutlookMailRead, msrOutlookMailCompose, msrOutlookContact, msrOutlookTask, mstOutlookPostRead.
On IdMso I have... nothing...

Thanks
Nano
Posted 13 Jul, 2010 04:57:40 Top
Andrei Smolin


Add-in Express team


Posts: 18279
Joined: 2006-05-11
Hi Nano,

  TAddInModule = class(TadxCOMAddInModule)
...
  private
    theRibbonUI: IRibbonUI;
  protected
...
  public
  end;

procedure TAddInModule.adxCOMAddInModuleOLExplorerFolderSwitch(
  Sender: TObject);
begin
  try
  adxRibbonTab1.Visible := not adxRibbonTab1.Visible;
  theRibbonUI.InvalidateControl(adxRibbonTab1.Id);
  except
  end;
end;

procedure TAddInModule.adxCOMAddInModuleRibbonLoaded(Sender: TObject;
  const RibbonUI: IRibbonUI);
begin
  theRibbonUI := RibbonUI;
end;


Will that do?

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Jul, 2010 06:43:55 Top
Nano




Posts: 3
Joined: 2010-07-13
Perfect! It works.
Thanks you very much!

Greez from switzerland
Posted 13 Jul, 2010 06:58:58 Top