473,378 Members | 1,218 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

User Control: Can't set property to Nothing at design time

I am making a User Control in visual basic, it contains a
Picture Box. To allow the image to change at design time I
added a property.
When changing a *normal* PictureBox Image at design time
in the properties window the delete key usually sets the
Image to nothing, but when I tried this with my new
property it did not work.

I have a feeling something needs to be added to the
property statement in order to accept Nothing for any
object, but I did not find an article on this.

Here is my Property code, at least it allows me to change
the picture at design time:

Property CurrentImage() As Image

' Retrieves the value of the Image.
Get
Return PictureBox.Image
End Get

' Updates the value of the Image.
Set(ByVal NewImage As Image)
PictureBox.Image = NewImage
End Set

End Property

So what needs to be added? I just want to make the delete
key set the Image to Nothing at design time like most
natural components in visual studio can.
I have a work around set up, but I would like to know the
proper way to do this.

Thanks in advance.
Jul 21 '05 #1
0 1490

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Steven.Xu | last post by:
Hi, everyone. I am writting an user control. There has some properties on it. At the design time, the properties will disply on the property windows and user could change it's value after selected...
3
by: CsaaGuy | last post by:
Hi, i created a class that i have showing up at design time and i have to save some of the properties to the viewstate at runtime. It all works fine, however the issue is if i have more that one...
8
by: David Lozzi | last post by:
Howdy, I have a user control that is a report to display data. On the page the control is inserted in, I have filter options to filter the report. When I try to do something like this, nothing...
0
by: Tom | last post by:
I am having a really annoying issue with serialization and a .NET User Control I am writing. For example, let's say I have a couple of classes in my control - first class is like: Public Class...
4
by: Michael | last post by:
Dear all .. If I want to use develop a user control and declare a public property which the type is System.Windows.Forms.GridTableStylesCollection For example : Public Class LookAndView...
0
by: Ivan D. | last post by:
I am making a User Control in visual basic, it contains a Picture Box. To allow the image to change at design time I added a property. When changing a *normal* PictureBox Image at design time in...
4
by: David Hearn | last post by:
I need to pass some variables to a user control so that some functions that are in it can use them. I am trying to set a public property that I have in it but it isn't working for some reason and I...
8
by: mark.norgate | last post by:
I've run into a few problems trying to use generics for user controls (classes derived from UserControl). I'm using the Web Application model rather than the Web Site model. The first problem...
11
by: Rimpinths | last post by:
I'm new at developing user controls in C#, and one thing I've noticed right off the bat is that the constructor gets called twice -- once at design time, once at run time. In short, I'm trying...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.