internal void UpdateListView() { Debug.Assert(listView.IsHandleCreated, "ApplySavedState Precondition: List-view handle must be created"); NativeMethods.LVINSERTMARK lvInsertMark = new NativeMethods.LVINSERTMARK { dwFlags = appearsAfterItem ? NativeMethods.LVIM_AFTER : 0, iItem = index }; UnsafeNativeMethods.SendMessage(new HandleRef(listView, listView.Handle), (int)LVM.SETINSERTMARK, 0, lvInsertMark); if (!color.IsEmpty) { listView.SendMessage((int)LVM.SETINSERTMARKCOLOR, 0, COLORREF.ColorToCOLORREF(color)); } }
public unsafe static void ShowPopup(Control parent, string caption, Point location) { Debug.WriteLineIf(WindowsFormsHelpTrace.TraceVerbose, "Help:: ShowPopup"); var pop = new HH_POPUPW { cbStruct = sizeof(HH_POPUPW), pt = location, rcMargins = new RECT(-1, -1, -1, -1), // Ignore clrForeground = -1, // Ignore clrBackground = COLORREF.ColorToCOLORREF(SystemColors.Window) }; fixed(char *pszText = caption) { pop.pszText = pszText; ShowHTML10Help(parent, null, HelpNavigator.Topic, pop); } }
private unsafe void updateMetricsButton_Click(object sender, EventArgs e) { ListViewGroup group = listView1.Groups[0]; int id = (int)typeof(ListViewGroup).GetProperty("ID", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(group); //listView1.MultiSelect = true; var metrics = new LVGROUPMETRICS { cbSize = (uint)sizeof(LVGROUPMETRICS), mask = LVGMF.BORDERSIZE | LVGMF.BORDERCOLOR }; metrics.Right = 50; metrics.Left = 50; metrics.Top = 50; metrics.Bottom = 50; metrics.crRight = (uint)COLORREF.ColorToCOLORREF(Color.Red); metrics.crLeft = (uint)COLORREF.ColorToCOLORREF(Color.Red); metrics.crTop = (uint)COLORREF.ColorToCOLORREF(Color.Red); metrics.crBottom = (uint)COLORREF.ColorToCOLORREF(Color.Red); IntPtr r = User32.SendMessageW(listView1.Handle, (User32.WindowMessage)LVM.SETGROUPMETRICS, (IntPtr)id, ref metrics); }
internal unsafe void UpdateListView() { Debug.Assert(listView.IsHandleCreated, "ApplySavedState Precondition: List-view handle must be created"); var lvInsertMark = new LVINSERTMARK { cbSize = (uint)sizeof(LVINSERTMARK), dwFlags = appearsAfterItem ? LVIM.AFTER : LVIM.BEFORE, iItem = index }; User32.SendMessageW(listView, (User32.WindowMessage)LVM.SETINSERTMARK, IntPtr.Zero, ref lvInsertMark); if (!color.IsEmpty) { User32.SendMessageW(listView, (User32.WindowMessage)LVM.SETINSERTMARKCOLOR, IntPtr.Zero, (IntPtr)COLORREF.ColorToCOLORREF(color)); } }