0

I have created a call back method getEnabled = Get2DButtonEnable the method is shown below

public bool bolEnabled;

//load the UI for the addin
public void Ribbon_Load(Office.IRibbonUI ribbonUI)
{
    this.ribbon = ribbonUI;
    bolEnabled = true;
}

public bool Get2DButtonEnable(Office.IRibbonControl control, ref bool enabled)
{
    switch (control.Id)
    {
        case "btn2d": 
            enabled = bolEnabled; 
            break;                
    }

    return false;
}

Now i want to call this method inside another method in different class. I created instance of the ribbon class and trying to call this method in the other class like visRibbon.Get2DButtonEnable(). What should I pass the parameter to this method?

Xaruth
  • 4,034
  • 3
  • 19
  • 26
roopini n
  • 503
  • 2
  • 7
  • 29

1 Answers1

0

You could use Ribbon.InvalidateContol("btn2d") This will force to call all the events associated with control btn2d.

More in MSDN

Kiru
  • 3,489
  • 1
  • 25
  • 46