Category / Section
How to get the location of a bar with respect to screen in MainFrameBarManager?
1 min read
Get location of a bar
The CommandBar.Location property helps to get the location of a Bar with respect to screen. Please refer the below code snippet which illustrates this:
C#
private void button1_Click(object sender, EventArgs e) { CommandBar cbe = mainFrameBarManager1.GetBarControl(bar1); this.textBox1.Text=cbe.PointToScreen(cbe.Location).ToString(); }
VB
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim cbe As CommandBar = MainFrameBarManager1.GetBarControl(Bar1) Me.TextBox1.Text = cbe.PointToScreen(cbe.Location).ToString() End Sub
Sample: http://help.syncfusion.com/support/samples/KB/Tools.Windows/TLocation/Location.zip