Toggle Outlook form between hide and show

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

Toggle Outlook form between hide and show
 
JTV77


Guest


Hi,

I have two Outlook forms and one controls the visibility of the other. When I click on a button in the first form it will hide/show the other form. Currently upon the first click I can make the second form hide. However, upon trying to un-hide the form, it does not re-appear. I was using the following code to control the visibility:

bool isFormShowing = adxOlFormsCollectionItem2.Enabled;

if (isFormShowing == false)
{
adxOlFormsCollectionItem2.RestoreFromMinimizedState = true;
adxOlFormsCollectionItem2.Enabled = true;
}
else{
adxOlFormsCollectionItem2.Enabled = false;
}

I did originally just use .Enabled = !isFormShowing, but this did not work and so I also tried using RestoreFromMinimizedState[/CODE]
Posted 28 Dec, 2011 08:38:00 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Hello,

Check this sample project:

Project: How to set the visibility of the form in an Outlook advanced form region
Language: C#
Page: http://www.add-in-express.com/support/addin-c-sharp.php

The VB.NET version of this project is available at http://www.add-in-express.com/support/addin-vb-net.php, title is: Controlling the visibility of a custom form in Outlook.


Andrei Smolin
Add-in Express Team Leader
Posted 29 Dec, 2011 05:21:46 Top