We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

XPToolbar Question.

Thread ID:





25956 Mar 10,2005 04:22 PM UTC Mar 10,2005 07:36 PM UTC WinForms 1
Tags: Tools
Jonathan Scolamiero
Asked On March 10, 2005 04:22 PM UTC

Is it possible to find the right clicked BarItem on an XPToolBar using a Point? I''ve been trying to use the XPToolBar.HitTest method to return the BarItem that a Context Popup had been activated on, however it isn''t returning anything even when I''ve clicked on a BarItem. Please help as soon as possible. Thanks, Jon

Administrator [Syncfusion]
Replied On March 10, 2005 07:36 PM UTC

Hi Jon, You could do so by handling the MouseDown event of the BarControlInternal associated with the XPToolBar as shown below in code : ((BarControlInternal)this.xpToolBar1).MouseDown += new MouseEventHandler(XPToolBar_BarControlInternal_MouseDown); private void XPToolBar_BarControlInternal_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { BarControlInternal bcint = sender as BarControlInternal; Point pt = bcint.PointToScreen(new Point (e.X,e.Y)); BarItem bitem = bcint.HitTest(pt.X, pt.Y) as BarItem; Console.WriteLine(bitem.Text); } } Please refer to the test sample attached that illustrates the above and let me know if this works for you. Regards, Guru Patwal Syncfusion, Inc.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon