Form width is not consistent

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

Form width is not consistent
 
santhosh venkatesh




Posts: 9
Joined: 2020-02-20
Hi,

I am getting an instance of ADXOlForm in ThisAddIn.cs of Outlook AddIn as below

public TestADXOlForm tpControl;
Dispatcher.Invoke(() =>
{
this.FormsManager = AddinExpress.OL.ADXOlFormsManager.CurrentInstance;
this.FormsManager.OnInitialize +=
new AddinExpress.OL.ADXOlFormsManager.OnComponentInitialize_EventHandler(this.FormsManager_OnInitialize);
this.FormsManager.Initialize(this);
});
#endregion
Dispatcher?.Invoke(() =>
{
tpControl = TestADXOlFormItem.FormInstances(0) as TestADXOlForm;
tpControl.Width = 65;
});

But the width of tpControl shown as 292 at a later point while debugging.
One more issue is when I try to change tpControl width to 65 later, the width of tpControl shown as 74.

Below is how the form is being initialized
TestADXOlFormItem= new ADXOlFormsCollectionItem();
TestADXOlFormItem.ExplorerLayout = ADXOlExplorerLayout.DockRight;
TestADXOlFormItem.ExplorerItemTypes = ADXOlExplorerItemTypes.olMailItem;
TestADXOlFormItem.AlwaysShowHeader = false;
TestADXOlFormItem.ExplorerAllowedDropRegions = ADXOlExplorerAllowedDropRegions.DockRight;
TestADXOlFormItem.IsMinimizedStateAllowed = false;
TestADXOlFormItem.IsDragDropAllowed = false;
TestADXOlFormItem.CloseButton = false;
TestADXOlFormItem.UseOfficeThemeForBackground = true;
TestADXOlFormItem.FormClassName = typeof(TestADXOlForm).FullName;
TestADXOlFormItem.Cached = ADXOlCachingStrategy.OneInstanceForAllFolders;
TestADXOlFormItem.Splitter = ADXOlSplitterBehavior.None;
TestADXOlFormItem.IsHiddenStateAllowed = false;
this.FormsManager.Items.Add(TestADXOlFormItem);

Everything was working fine when TestADXOlFormItem.ExplorerLayout = ADXOlExplorerLayout.RightReadingPane
I would like to know why is the width changing automatically than what we set.

Thanks
Siva
Posted 14 Jun, 2020 02:59:57 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Siva,

The size depends on may things at this point. Could you please provide us with a sample project reproducing that issue?

You can send it to the support email address; find it in {Add-in Express installation folder}\readme.txt; please make sure your email contains a link to this topic.


Andrei Smolin
Add-in Express Team Leader
Posted 15 Jun, 2020 09:41:21 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Sorry, on may --> on many


Andrei Smolin
Add-in Express Team Leader
Posted 15 Jun, 2020 09:41:51 Top
santhosh venkatesh




Posts: 9
Joined: 2020-02-20
Hi Andrei,

I have sent a sample project reproducing the issue via the support service page. Please do the needful.

Regards
Siva
Posted 17 Jun, 2020 06:36:01 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Siva,

I've just received a word from our guys. What you see is a result of two issues. First off, the minimal pane width is 84 in your case; you use a Dock* region which is implemented using Microsoft's Custom Task Pane.

You should know that this value is set by Office, it depends on the current DPI in an undocumented fashion, and there's no way to get this value beforehand. When you try to set the width to a value less than this, your form width will be reset to that width.

The other issue is an Add-in Express related. When performing calculations and drawing *when your form is being reset to the minimal width*, there's some issue that spoils the picture. We will look into this but you shouldn't expect anything grand: you can't set the form width less than the minimal value and you can't find that value ahead of time.


Andrei Smolin
Add-in Express Team Leader
Posted 17 Jun, 2020 07:09:53 Top
santhosh venkatesh




Posts: 9
Joined: 2020-02-20
Hi Andrei,

Do you mean that the minimum width for a custom task pane in Outlook is 84?
Regarding Add-in Express related - what is the issue when the form width is being set to default.

Regards
Siva
Posted 18 Jun, 2020 00:56:56 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Siva,

santhosh venkatesh writes:
Do you mean that the minimum width for a custom task pane in Outlook is 84?


I wrote:

the minimal pane width is 84 in your case


This value depends on the DPI used: you can change DPI to check this. It is defined by the underlying Custom Task Pane.

When you set the width, say, to 65, Add-in Express sets that width to the form and then it detects that the pane width is not 65 but it is set to 84. Here, Add-in Express processes this new width and, we suppose, it does this in a wrong DPI context and this causes the incorrect values that you get; a research is required to get the full understanding of the issue. We've filed it down under #18106 in our issue-tracking DB. When the issue is fixed, you'll see this number in whatsnew.txt.


Andrei Smolin
Add-in Express Team Leader
Posted 18 Jun, 2020 03:19:14 Top