[Mono-bugs] [Bug 445384] After DoDragDrop wrong data format in DragEventArgs.Data on DragOver event

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Aug 20 16:40:14 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=445384

User harry at harryfino.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=445384#c4


Harry Finocchiaro <harry at harryfino.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |harry at harryfino.com




--- Comment #4 from Harry Finocchiaro <harry at harryfino.com>  2009-08-20 14:40:12 MDT ---
I've tested this in the windows release of 2.4.2.3 and it's still broken.

My test was simple: I have a PictureBox (pictureBox1) that is the child of a
Panel (panel1). I'm trying to drag the PictureBox into a second Panel (panel2).

When the DragDrop event for Panel2 fires, I message box the results of the
function "e.Data.GetFormats()". MS.Net will display
"System.Windows.Forms.PictureBox", and Mono will display "FileDrop".

Here is the event code:

private void pictureBox1_MouseMove( object sender, MouseEventArgs e )
{
    if ( e.Button == MouseButtons.Left )
        pictureBox1.DoDragDrop( pictureBox1, DragDropEffects.Move );
}

private void panel2_DragDrop( object sender, DragEventArgs e )
{
    foreach ( var item in e.Data.GetFormats() )
        MessageBox.Show( item );

    PictureBox obj = e.Data.GetData( typeof( PictureBox ) ) as PictureBox;
    if ( obj == null )
    {
        MessageBox.Show( "Failed to get the dropped object" );
        return;
    }

    panel2.Controls.Add( obj );            
}

private void panel2_DragEnter( object sender, DragEventArgs e )
{
    e.Effect = DragDropEffects.Move;
}

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list