form size of ADX Task pane in an Outlook add in not saved in VS Designer

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

form size of ADX Task pane in an Outlook add in not saved in VS Designer
Save ADX Task Pane form in Visual Studio do not include the form size in xxx.designer.cs. Reopen the form in VS designer the form size is always 1942 x 1102.  
Jock Hartvig Andersen




Posts: 6
Joined: 2017-08-16
I have problem with the form size in Visual Studio for an Outlook ADX Task pane.

When I save the form in Visual Studio, the form size is not saved.
Reopen the form in VS designer the form size is always 1942 x 1102.
In xxx.designer.cs I can see that the this.clientsize line is missing.

I created a new test project and that works fine with clientsize line save ok.
I have also tried to change sevarl of the properties, but nothing has helped me.
I have not been alble to find any topics on this in you forum.

Do you have any idea about what is wrong with my VS project?

I have made a temporary fix by assign a value to ClientSize property in Form constructer:
public ADXOlFormSendSms()
{
InitializeComponent();
// Temporary due to VS Designer not saving ClientSize
this.ClientSize = new System.Drawing.Size(600,730);
}

I use VS 15.7, Add-in-Express 9.1

Regards
Jock Hartvig Andersen
Posted 30 Sep, 2018 14:40:02 Top
Andrei Smolin


Add-in Express team


Posts: 16670
Joined: 2006-05-11
Hello Jock,

Can it be that the AddinModule.Designer.cs file is read-only for some reason?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 01 Oct, 2018 02:02:10 Top
Jock Hartvig Andersen




Posts: 6
Joined: 2017-08-16
Hi Andrei,

No.

I can edit the xx.designer.cs

I tried to add the ClientSize line, save and then open form in VS designer.
Then the form is displayed with correct size.

Regards Jock
Posted 01 Oct, 2018 02:23:38 Top
Andrei Smolin


Add-in Express team


Posts: 16670
Joined: 2006-05-11
Thank you for letting me know!

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 01 Oct, 2018 03:28:34 Top
Jock Hartvig Andersen




Posts: 6
Joined: 2017-08-16
Hi Andrei,

I am not sure if you understood that I still have the problem.

When I reload after saving, the form again has the size 1942 x 1102,
Because the ClientSize line is not part of the xxx.desingner.cs.

Regards Jock
Posted 01 Oct, 2018 04:21:59 Top
Andrei Smolin


Add-in Express team


Posts: 16670
Joined: 2006-05-11
Hello Jock,

I'm sorry for the confusion.

I create a new form and see its size is set to 300x300: in InitializeComponent located in ADXOlForm1.Designer.cs I see this line this.ClientSize = new System.Drawing.Size(300, 300). I switch to the designer and change the form size: the designer reflects this change in the InitializeComponent() method: this.ClientSize = new System.Drawing.Size(185, 195). What of the above doesn't work or works differently for you?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 01 Oct, 2018 09:46:31 Top
Jock Hartvig Andersen




Posts: 6
Joined: 2017-08-16
Hi Andrei,

When I save the form, the ClientSize line is not in the xxx.designer.cs file.
I have two forms in the VS project. The problem goes for both.
Part of ADXOlFormSendSms.designer.cs:
//
// ADXOlFormSendSms
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.BackColor = System.Drawing.Color.White;
resources.ApplyResources(this, "$this");
this.Controls.Add(this.buttonTo);
.
.
.
this.Controls.Add(this.lblFrom);
this.Controls.Add(this.btnSend);
this.Controls.Add(this.txtSmsText);
this.Controls.Add(this.txtTo);
this.Controls.Add(this.lblSmsText);
this.Name = "ADXOlFormSendSms";
this.ADXEnter += new AddinExpress.OL.ADXEnterEventHandler(this.ADXOlFormSendSms_ADXEnter);
this.ADXLeave += new AddinExpress.OL.ADXLeaveEventHandler(this.ADXOlFormSendSms_ADXLeave);
this.Load += new System.EventHandler(this.ADXOlFormSendSms_Load);
this.Enter += new System.EventHandler(this.ADXOlFormSendSms_Enter);
this.Leave += new System.EventHandler(this.ADXOlFormSendSms_Leave);
((System.ComponentModel.ISupportInitialize)(this.pictureBox_EditTemplate)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxLogo)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox_Add_Recipient)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox_RemoveRecipient)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox_AddSender)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.errorProvider2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.errorProvider3)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();

}


I created a new form ADXOlForm1 in the VS project. This form behaves correct.
In this new form I see a "property" AutoScaleDimensions , that is not vivible in designer properties list and neither is in my problem form.
From ADXOlForm1.designer.cs:
private void InitializeComponent()
{
this.SuspendLayout();
//
// ADXOlForm1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(294, 636);
this.Location = new System.Drawing.Point(0, 0);
this.Name = "ADXOlForm1";
this.Text = "ADXOlForm1";
this.ResumeLayout(false);

}

Property Localizable was true in my problem form and false in the test form ADXOlForm1.
So I tried to set Localizable to false.
And vupti the ClientSize line reappears in designer.cs.

Why this behavior when using property Localizable?
If you are not allowed to set Localizable it should not be there.
I believe this is a bug.

So my first problem is solved but why this behavior of Localizable?
Can I not use Localizable in ADX forms?

regards Jock
Posted 02 Oct, 2018 03:17:26 Top
Andrei Smolin


Add-in Express team


Posts: 16670
Joined: 2006-05-11
Hello Jock,

If you set Localizable=true, this means localizable properties (including ClientSize) of the form are stored in resources (.resx files), not in InitializeComponent.

ADXOlForm inherits this behavior from System.Windows.Forms.Form.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 02 Oct, 2018 10:20:13 Top