Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2007

Tip: Looking for answers? Try searching our database.

?? Why is PictureBox.AllowDrop Discouraged ??

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
A. Foxmore - 12 Jun 2007 17:41 GMT
Does anyone know why the PictureBox.AllowDrop property is discouraged? The
documentation indicates, "This property supports the .NET Framework
infrastructure and is not intended to be used directly from your code."

WHY??

I have several PictureBoxes that I would like to use as sources and targets
for drag & drop. Are there viable alternatives?

I know I *could* still use the PictureBox.AllowDrop property but I am
hesitant now after reading the documentation.

Thanks
Bob Powell [MVP] - 14 Jun 2007 18:20 GMT
How would you expect the PictureBox to react as a drop target?

The window being dropped on must look to see if it accepts the thing
being dropped, signal the acceptance or rejection to the user and then
accept / decode / display whatever it was that got dropped.

It would be easier to create a control based object that handled your
various drop formats than try to coerce PictureBox, the worlds most
accursed control, into doing something_else_ it was never supposed to do.

Signature

Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

> Does anyone know why the PictureBox.AllowDrop property is discouraged? The
> documentation indicates, "This property supports the .NET Framework
[quoted text clipped - 9 lines]
>
> Thanks
Alan Foxmore - 15 Jun 2007 05:29 GMT
> How would you expect the PictureBox to react as a drop target?

I'm not sure what you're getting at here. The item I'm dropping is in fact
an Image from another PictueBox. Maybe you had the impression I was dropping
text or some custom data. Basically, I want to allow the user to move
various images between PictureBixes.

> The window being dropped on must look to see if it accepts the thing being
> dropped, signal the acceptance or rejection to the user and then accept /
> decode / display whatever it was that got dropped.

Yes, of course. But what you said here applies to *any* drop target.

As I said, dropping images between PictureBoxes should be no problem, as far
as I can see. In fact, even dropping text should be no problem -- if a user
were to drop text onto a PictureBox the text could easily be rendered as an
image by the PictureBox's DragDrop handler and then displayed in the
PictureBox -- nothing strange about that AFAIK.

So, again, I wonder why Microsoft has decided we should not be able to use
PictureBox as a drop target.

<SNIP>
>> Does anyone know why the PictureBox.AllowDrop property is discouraged?
>> The documentation indicates, "This property supports the .NET Framework
[quoted text clipped - 9 lines]
>>
>> Thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.