Profile Picture

Why 'NGalleryItem' is not a control??

Posted By Jiyong Yang Last Year
Author
Message
Jiyong Yang
Posted Last Year
View Quick Profile
Forum Newbie

Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 1, Visits: 8
i'm trying to use 'Nevron.UI.WinForm.Controls.NGalleryPanel', using 'NGalleryItem'.
Now i want to implement 'drag and drop' in NGalleryPanel.
'''code'''
private void Form1_DragDrop(object sender, DragEventArgs e)
   {
    NGalleryItem data = (NGalleryItem)e.Data.GetData(typeof(NGalleryItem));
    NGalleryPanel galleryPanel = (NGalleryPanel)sender;

    Point p = galleryPanel.PointToClient(new Point(e.X, e.Y));
    var item = galleryPanel.GetChildAtPoint(p);
    int index = galleryPanel.Controls.GetChildIndex(item, false);
    galleryPanel.Controls.SetChildIndex(data, index);
    galleryPanel.Invalidate();
   }

galleryPanel.Controls.SetChildIndex(data, index);
this cause error because "NGalleryItem" is not a control..

How can i implement drag and drop in NGalleryPanel??





Nevron Support Team
Posted Last Year
View Quick Profile
Supreme Being

Supreme Being (3,273 reputation)Supreme Being (3,273 reputation)Supreme Being (3,273 reputation)Supreme Being (3,273 reputation)Supreme Being (3,273 reputation)Supreme Being (3,273 reputation)Supreme Being (3,273 reputation)Supreme Being (3,273 reputation)Supreme Being (3,273 reputation)

Group: Moderators
Last Active: 1 days ago @ 8:33 AM
Posts: 2,593, Visits: 2,279
Hello Jiyong Yang,

Try to use Items collection instead of Controls:

galleryPanel.Items.SetIndex(data, index);



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic