logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
ronenfe  
#1 Posted : Thursday, February 18, 2010 7:10:50 AM(UTC)
ronenfe

Rank: Administration

Groups: Administration
Joined: 11/22/2008(UTC)
Posts: 175

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

Users browsing this topic
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.