/// <summary> /// Set the indentation using the level of this item /// </summary> /// <returns>True if successfull, false otherwise</returns> public bool SetIndentation() { if (!IsInATreeListView) { return(false); } bool res = true; APIsStructs.LV_ITEM lvi = new APIsStructs.LV_ITEM(); lvi.iItem = Index; lvi.iIndent = Level; if (TreeListView.ShowPlusMinus) { lvi.iIndent++; } lvi.mask = APIsEnums.ListViewItemFlags.INDENT; try { APIsUser32.SendMessage( ListView.Handle, APIsEnums.ListViewMessages.SETITEM, 0, ref lvi); } catch { res = false; } return(res); }
/// <summary> /// Set the indentation using the level of this item /// </summary> /// <returns>True if successfull, false otherwise</returns> public bool SetIndentation() { if(!IsInATreeListView) return false; bool res = true; APIsStructs.LV_ITEM lvi = new APIsStructs.LV_ITEM(); lvi.iItem = Index; lvi.iIndent = Level; if(TreeListView.ShowPlusMinus) lvi.iIndent++; lvi.mask = APIsEnums.ListViewItemFlags.INDENT; try { APIsUser32.SendMessage( ListView.Handle, APIsEnums.ListViewMessages.SETITEM, 0, ref lvi); } catch { res = false; } return res; }