I've searched around, and I'm not finding a solution to this one so I figured I'd ask you bright people:
Trying to pull form size information out of a database and pass it to a form upon instance.
The relevant code in the parent form is:
[code]
childForm.Size = (string)row["size"];
[/code]
and the relevant code in the childform is:
[code]
public string Size { get; set; }
and later, in the form initialization:
this.Size = new System.Drawing.Size(Size);
[/code]
I'm getting "Cannot implicitly convert type 'string' to 'System.Drawing.Size'".
When I change variable names and play around with it a bit, I'm getting: "Cannot implicitly convert type 'string' to 'System.Drawing.Point'"
The information in my Database is good - at runtime a messagebox in the initialization will show the proper window size. But I'm unable to pass that information to the form properly. Im sure it's a rookie mistake, but my web searches didn't show me a solution. Any help would be greatly appreciated.
Loading
Suthish NairPosted Dec 3, 2010, 12:58 PM
CrishPosted Dec 3, 2010, 3:53 AM
I have same problem and i had searched for Cannot implicitly convert type 'string' to 'System.Drawing.Size' even.thanks for giving me solution.It will help us.
Manikavelu VelayuthamPosted Dec 3, 2010, 1:10 AM
But the argument that to be passed in System.Drawing.Size( Point ) --> It should be of Point Type. or (int Width, int, Height)
Just change the argument in the above code. You wont get that error again.