PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
VS 2005 Designer issue
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
VS 2005 Designer issue
![]() |
VS 2005 Designer issue |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi All,
here it goes, I have created a usercontrol "image button" and it all work fine except for one strange thing, when i drag the control to a form "smart device that is" and then save that form i get this error Code generation for property 'Image' failed. Error was: 'Object reference not set to an instance of an object.' this only happends the first time i drag the control to a form and save the form after that error if add more controls other then my image button i save again it's ok in the property designer the image property is set to (none) now if in my constructor i had this line this.image = new Bitmap(21, 21); it all works ok any idea y this is appening |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Are you attempting to utilize the Image property, or the "image" field
behind the property, from anywhere within your custom control while it's still "null"? In other words, have you gone through the source for your control to ensure that no attempt is made to access the image object while it is still set to "null". -- Tim Wilson ..NET Compact Framework MVP "dantheman" <daniel_st.pierre@fpl.com> wrote in message news:1137433925.403299.170300@g14g2000cwa.googlegroups.com... > Hi All, > > here it goes, > > I have created a usercontrol "image button" and it all work fine except > for one strange thing, when i drag the control to a form "smart device > that is" and then save that form i get this error > > Code generation for property 'Image' failed. > Error was: 'Object reference not set to an instance of an object.' > > this only happends the first time i drag the control to a form and save > the form after that error if add more controls other then my image > button i save again it's ok > > in the property designer the image property is set to (none) > > now if in my constructor i had this line > this.image = new Bitmap(21, 21); > it all works ok > > any idea y this is appening > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
yep that was the problem
thanks Tim |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

