public void RemoveToolTipRegion(int regionID) { if (this._tipWindow != null) { Interop.TOOLINFO lParam = new Interop.TOOLINFO(); lParam.hwnd = this._owner.Handle; lParam.uId = (IntPtr) regionID; Interop.SendMessage(this._tipWindow.Handle, Interop.TTM_DELTOOL, 0, lParam); } }
public void AddToolTipRegion(string toolTipText, int regionID, Rectangle regionBounds) { if ((((toolTipText != null) && (toolTipText.Length != 0)) && !regionBounds.IsEmpty) && (this._tipWindow != null)) { Interop.TOOLINFO lParam = new Interop.TOOLINFO(); lParam.hwnd = this._owner.Handle; lParam.uId = (IntPtr) regionID; lParam.lpszText = toolTipText; lParam.rect = Interop.RECT.FromXYWH(regionBounds.X, regionBounds.Y, regionBounds.Width, regionBounds.Height); lParam.uFlags = 0x10; Interop.SendMessage(this._tipWindow.Handle, Interop.TTM_ADDTOOL, 0, lParam); } }
private void InitializeComboBoxes() { int wParam = -1; foreach (ToolBarButton button in base.Buttons) { wParam++; ComboBoxToolBarButton button2 = button as ComboBoxToolBarButton; if ((button2 != null) && button2.Visible) { MxComboBox comboBox; Panel comboBoxHolder; Interop.RECT lParam = new Interop.RECT(); Interop.SendMessage(base.Handle, 0x41d, wParam, ref lParam); if (base.RecreatingHandle) { comboBoxHolder = button2.ComboBoxHolder; comboBox = button2.ComboBox; button2.SetParentRecreating(false); } else { comboBoxHolder = new Panel(); button2.ComboBoxHolder = comboBoxHolder; comboBox = button2.CreateComboBox(); } int height = comboBox.Height; int y = (lParam.Height - height) / 2; comboBox.SetBounds(1, y, lParam.Width - 2, height); comboBoxHolder.Controls.Add(comboBox); base.Controls.Add(comboBoxHolder); Interop.SetWindowPos(comboBoxHolder.Handle, IntPtr.Zero, lParam.left, lParam.top, lParam.Width, lParam.Height, 0x54); if ((button2.ToolTipText != null) && (button2.ToolTipText.Length != 0)) { IntPtr hWnd = Interop.SendMessage(base.Handle, 0x423, 0, 0); if (hWnd != IntPtr.Zero) { Interop.TOOLINFO toolinfo = new Interop.TOOLINFO(); toolinfo.uFlags = 0x11; toolinfo.hwnd = toolinfo.uId = comboBox.Handle; toolinfo.lpszText = button2.ToolTipText; Interop.SendMessage(hWnd, Interop.TTM_ADDTOOL, 0, toolinfo); } } this.OnComboBoxCreated(new ToolBarComboBoxButtonEventArgs(button2)); } } }