How to show\hide embeded form programmatically?

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

How to show\hide embeded form programmatically?
 
Goran Vidic




Posts: 61
Joined: 2009-04-24
Hi,

I was wondering is it possible to show\hide ADXOlForm form (ADXOlFormsCollectionItem) programmatically?

It seems that the following code does not produce result as expected:


AddinExpress.OL.ADXOlForm selectedForm = null;
for (int i = 0; i < adxOlFormsCollectionItem2.FormInstanceCount; i++)
{
    selectedForm = adxOlFormsCollectionItem2.FormInstances(i);
    if (selectedForm is frmTaskViews)
    {
        if (SETTINGS.DefaultView == Enums.ViewsOptions.NONE.ToString())
        {
            (selectedForm as frmTaskViews).Hide();
        }
        else
        {
            (selectedForm as frmTaskViews).Show();
        }
    }
}


Any example with source code would be welcomed!

Regards, G. Vidic
Posted 02 Oct, 2009 04:37:44 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hi Goran,

Please see http://www.add-in-express.com/support/addin-c-sharp.php#form-regions


Andrei Smolin
Add-in Express Team Leader
Posted 02 Oct, 2009 05:29:54 Top
Goran Vidic




Posts: 61
Joined: 2009-04-24
Hi Andrei,

I have a settings window where I want to set forms visibility for my ADXOlForm form, so, concept from your example does not work for me.
Any other idea how to show\hide the form from within method in "public class AddinModule".

Regards, Goran
Posted 05 Oct, 2009 02:55:59 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hi Goran,

To prevent your form from being shown, you may choose to cancel the ADXBeforeFormInstanceCreate event of the Outlook Forms Manager or, in the ADXBeforeFormShow event of the form, set <theForm>.Visible = false. Accordingly, if you don't do the above, the form is shown.


Andrei Smolin
Add-in Express Team Leader
Posted 05 Oct, 2009 08:26:37 Top