I am trying to write a program that utilizes a 3rd party ActiveX control in a .NET 3.5 project. I add it to my form using toolbox and it adds AxLEADLib, LEADLib, and stdole to my project’s references.
However the code that is auto generated puts in
this.axLEAD1.Size = new System.Drawing.Size(100, 50);
But in AxLEAD there exists both
public System.Drawing.Size Size {get; set;}
public virtual short Size(float fWidth, float fHeight, short iFlags)
So when I try to set the size of the control on my form, in the designer.cs I get the error Cannot assign to 'Size' because it is a 'method group'. What can I do to get around this issue? How do I set my size of my control?
This is a project being ported over from VB6 and there does not appear to be anything special done in the old project to handle this.
I could not get Hans’ solution to work right but I did find a workaround. I change the erroring line to
And it works fine. I just need to correct it every time the code regenerates.