public static void SetTask(this ListViewGroup group, string task) { var groupId = GetGroupId(group); if (groupId >= 0) { using (var lvgroup = new ComCtl32.LVGROUP { Task = task }) SendMessage(new HandleRef(group.ListView, group.ListView.Handle), ComCtl32.ListViewMessage.LVM_SETGROUPINFO, groupId, lvgroup); } }
public static void SetFooter(this ListViewGroup group, string footer = null, HorizontalAlignment footerAlignment = HorizontalAlignment.Left) { var groupId = GetGroupId(group); if (groupId >= 0) { using (var lvgroup = new ComCtl32.LVGROUP { Footer = footer, Alignment = MakeAlignment(group.HeaderAlignment, footerAlignment) }) SendMessage(new HandleRef(group.ListView, group.ListView.Handle), ComCtl32.ListViewMessage.LVM_SETGROUPINFO, groupId, lvgroup); } }
private static void SetState(ListViewGroup group, ComCtl32.ListViewGroupState state, bool value) { var groupId = GetGroupId(group); if (groupId >= 0) { var lvgroup = new ComCtl32.LVGROUP(ComCtl32.ListViewGroupMask.LVGF_STATE); { lvgroup.SetState(state, value); SendMessage(new HandleRef(group.ListView, group.ListView.Handle), ComCtl32.ListViewMessage.LVM_SETGROUPINFO, groupId, lvgroup); } } }
public static void SetImage(this ListViewGroup group, int titleImageIndex, string descriptionTop = null, string descriptionBottom = null) { var groupId = GetGroupId(group); if (groupId >= 0) { using (var lvgroup = new ComCtl32.LVGROUP { TitleImageIndex = titleImageIndex }) { if (descriptionBottom != null) { lvgroup.DescriptionBottom = descriptionBottom; } if (descriptionTop != null) { lvgroup.DescriptionTop = descriptionTop; } SendMessage(new HandleRef(group.ListView, group.ListView.Handle), ComCtl32.ListViewMessage.LVM_SETGROUPINFO, groupId, lvgroup); } } }