picturebox allowdrop property missing?
Does anyone know why the .AllowDrop property of the picturebox control is missing at design time? My guess is it has to be a bug.
Controls that allow drag/drop operations (even windows form does) have a .AllowDrop property to tell the control to receive drag/drop events or not. You can set this in the properties window at design time, except for the picturebox. The picturebox is missing the property and you have to set it in code in the form constructor or form load event (or anywhere prior to wanting it to get drag/drop events)
My guess is the param they put on properties to indicate it to show up in the properties window is set wrong for the picturebox control... can anyone see if this exists on 05 beta 2? Its not installed here...
Re: picturebox allowdrop property missing?
I think you must be right, the property is listed on MSDN2.
Re: picturebox allowdrop property missing?
It is not available at design time in 2005 either.
Re: picturebox allowdrop property missing?
Maybe I will see if I can report it to MS, It just seems like the thing that they would already know about just from using the control...
Re: picturebox allowdrop property missing?
hmm I'm using C# and it doesnt even show up in intellisense! (compiles if I use it though).
Maybe they didnt want us to use it for some reason?
Re: picturebox allowdrop property missing?
that is silly though because its the ONLY way to get drag/drop events to work on a picture box.
Also AllowDrop is inherited from the control class, so it should be available to the picturebox without any reason otherwise..
http://msdn.microsoft.com/library/de...mberstopic.asp
Re: picturebox allowdrop property missing?
There might be something stated about this on MSDN perhaps?
the picturebox class seems to override that property and hide it from the user. See for yourself in Reflector if you want;)
it sets browsable to false, and editbrowsabel to never :(
maybe the bright developers intended for this to be a control merely for displaying pictures? you could put it in a panel control, OR, just do it via code:D
Re: picturebox allowdrop property missing?
got a response from MS today.
Quote:
Matt,
Thank you for contacting the .NET Framework team. We appreciate your comments. By taking the time to write, you are helping us to improve the quality of our documentation and samples.
The PictureBox control is not designed to allow drag and drop procedures. However, since PictureBox inherits from control, it also inherits the AllowDrop property. To clarify this, in the next release of the documentation, the PictureBox.AllowDrop topic will be marked with the “for internal use only” boilerplate. Also, the PictureBox.AllowDrop property will not appear in intellisense if you are using the Visual Studio text editor.
I emailed back asking why a control that simply inherits the functionality would need to "hide" it.. or from what they say, totally eliminate it in a future release. I asked what negative impact drag/drop with a picture box could have, since I can think of plenty of good reasons to have it.
Re: picturebox allowdrop property missing?
I see
what's the reason though :confused:
maybe they have had bugs with it
Re: picturebox allowdrop property missing?
I emailed back asking that already
Re: picturebox allowdrop property missing?
Ran into the same problem!!
When your form loads:
PictureBox1.AllowDrop = True
This is how I get around it.
Using VS2010.
Re: picturebox allowdrop property missing?
There are several (could be a lot more than i know of) properties that aren't listed in the properties window or intellisense.
The PrintPreviewDialog's WindowState property is another example
Re: picturebox allowdrop property missing?
Not for nothing, this thread is 7 years old. :wave: