Why 'NGalleryItem' is not a control??


Author
Message
Jiyong Yang
Jiyong Yang
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
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
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hello Jiyong Yang,

Try to use Items collection instead of Controls:

galleryPanel.Items.SetIndex(data, index);



Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic
2 active, 2 guests, 0 members, 0 anonymous
No members currently viewing this topic!

Login

Explore
Messages
Mentions
Search