This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, September 30, 2010 12:40:10 AM(UTC)
Groups: Registered
Posts: 21
Hello.. I am doing the project in c#(windows applicatio) with leadtool16.. and using RasterImageList control in my application...actually, i wana select item with mouse right button click in the item of control. and i want to work double click event only with item double click..pls help me fast...
#2
Posted
:
Thursday, September 30, 2010 6:09:44 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
If you mean you want to the right-click mouse click to select the item, you can use this code. If you mean something else, please let me know.
private void imageList1_MouseClick(object sender, MouseEventArgs e)
{
// Check for right button clicks
if (e.Button == MouseButtons.Right)
{
// Check if any item is under the cursor poisition
RasterImageList imageList = sender as RasterImageList;
RasterImageListItem item = imageList.HitTest(e.X, e.Y);
if (item != null)
{
for (int i = 0; i < imageList1.Items.Count; i++)
{
if (item == imageList1.Items[i])
imageList1.Items[i].Selected = true;
}
}
}
}
You can also use the same HitTest method with double click event to test if you're getting it while the mouse cursor is inside an item or not.
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.