TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Hurkagurk
NA
5
35.7k
Cannot implicitly convert type 'string' to 'System.Drawing.Size'
Dec 3 2010 12:59 AM
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.
Reply
Answers (
3
)
Creating a custom solution to link a new instance of a form to a DB?
Callouts(Balloons) in C# Aplication without using third party control