This document is archived and information here might be outdated.  Recommended version.


IToolbarControl.GetItemRect Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Controls)  

IToolbarControl.GetItemRect Method

Returns the dimensions of the item at the specified index.

[Visual Basic .NET]
Public Sub GetItemRect ( _
    ByVal index As Integer, _
    ByRef Top As Integer, _
    ByRef Left As Integer, _
    ByRef Bottom As Integer, _
    ByRef Right As Integer _
)
[C#]
public void GetItemRect (
    int index,
    ref int Top,
    ref int Left,
    ref int Bottom,
    ref int Right
);
[C++]
HRESULT GetItemRect(
  long index,
  long* Top,
  long* Left,
  long* Bottom,
  long* Right
);
[C++]

Parameters index [in] index is a parameter of type long Top [in, out] Top is a parameter of type long Left [in, out] Left is a parameter of type long Bottom [in, out] Bottom is a parameter of type long Right [in, out] Right is a parameter of type long

Product Availability

Available with ArcGIS Engine.

Description

Returns the dimensions in pixels of the item at the specified index on the ToolbarControl. An item's rectangle refers to the area on the ToolbarControl occupied by the button, text box or combo box. These rectangles are adjacent. For example, if the first item had a left value of 2, and a right value of 26, the second item would have a left value of 26.

Errors Returned

1023 800a03ff: The specified index is out of range

[C#]
int top=0; int left=0; int bottom=0; int right=0;
axToolbarControl1.GetItemRect(0,ref top, ref left, ref bottom, ref right);
System.Windows.Forms.MessageBox.Show("Top:" + top + " Left:" + left + " Bottom:" + bottom + " Right:" + right);
[Visual Basic .NET]
Dim lTop As Long, lLeft As Long, lBottom As Long, lRight As Long
AxToolbarControl1.GetItemRect(0, lTop, lLeft, lBottom, lRight)
System.Windows.Forms.MessageBox.Show("Top:" & lTop & " Left:" & lLeft & " Bottom:" & lBottom & " Right:" & lRight)

See Also

IToolbarControl Interface