/// <summary> /// Returns the bounds of a subitem. /// </summary> /// <param name="itemIndex">Index of the item.</param> /// <param name="subItemIndex">Sub-item index.</param> /// <param name="area">Specifies for which portion bounds should be obtained.</param> /// <returns>Subitem rectangle.</returns> #else /// <summary> /// サブアイテムに外接する矩形を取得します。 /// </summary> /// <param name="itemIndex">アイテムインデックス。</param> /// <param name="subItemIndex">サブアイテムインデックス。</param> /// <param name="area">どの部分に概説する矩形かを指定します。</param> /// <returns>サブアイテム矩形。</returns> #endif public Rectangle GetSubItemRect(int itemIndex, int subItemIndex, LVIR area) { RECT nativeRect = new RECT(); nativeRect.Top = subItemIndex; nativeRect.Left = (int)area; AppVar inTarget = App.Dim(nativeRect); App[typeof(NativeMethods), "SendMessage"](Handle, LVM_GETSUBITEMRECT, new IntPtr(itemIndex), inTarget); return NativeDataUtility.ToRectangle((RECT)inTarget.Core); }
/// <summary> /// Returns an item's bounds. /// </summary> /// <param name="itemIndex">Item rectangle.</param> /// <param name="area">Specifies for which portion bounds should be obtained.</param> /// <returns>Item rectangle.</returns> #else /// <summary> /// アイテム矩形を取得します。 /// </summary> /// <param name="itemIndex">アイテムインデックス。</param> /// <param name="area">どの部分に概説する矩形かを指定します。</param> /// <returns>アイテム矩形。</returns> #endif public Rectangle GetItemRect(int itemIndex, LVIR area) { RECT rc = new RECT(); rc.Left = (int)area; AppVar inTarget = App.Dim(rc); App[typeof(NativeMethods), "SendMessage"](Handle, LVM_GETITEMRECT, new IntPtr(itemIndex), inTarget); return NativeDataUtility.ToRectangle((RECT)inTarget.Core); }