Rank: Administration
Groups: Administration
Joined: 11/22/2008(UTC) Posts: 179
|
inside the owner drawn listbox class: Code:
public void IndexFromPoint(Point pPoint)
{
this.SelectedIndex = this.vs.Value + (pPoint.Y / this.ItemHeight);
this.Refresh();
}
inside the main class: Code:
private void contextMenu1_Popup(object sender, EventArgs e) // when context menu is opening
{
try
{
Point pt = listBox.PointToClient(Control.MousePosition); listBox.IndexFromPoint(pt);
}
catch
{
MessageBox.Show("Error in context menu.");
}
}
Edited by user Thursday, February 18, 2010 7:11:43 AM(UTC)
| Reason: Not specified
|
|
|
|
Forum Jump
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.