/// <summary> /// Show a balloon tooltip for edit control. /// </summary> public void Show() { EDITBALLOONTIP ebt = new EDITBALLOONTIP(); ebt.pszText = Text; ebt.pszTitle = Title; ebt.ttiIcon = (int)Icon; ebt.cbStruct = Marshal.SizeOf(ebt); SendMessage(Parent.Handle, EM_SHOWBALLOONTIP, 0, ref ebt); }
public void TestMethod1() { Application.EnableVisualStyles(); var f = new Form { Size = new System.Drawing.Size(100, 100) }; var btn = new TextBox { Size = new System.Drawing.Size(50, 12), Location = new POINT(5, 5) }; var tip = new EDITBALLOONTIP("Test", "tested"); btn.HandleCreated += (s, a) => SendMessage(btn.Handle, EditMessage.EM_SHOWBALLOONTIP, 0, ref tip); f.Controls.Add(btn); f.ShowDialog(); }
public void Show() { EDITBALLOONTIP ebt = new EDITBALLOONTIP(); ebt.cbStruct = Marshal.SizeOf(ebt); ebt.pszText = m_text; ebt.pszTitle = m_title; ebt.ttiIcon = (int)m_titleIcon; IntPtr ptrStruct = Marshal.AllocHGlobal(Marshal.SizeOf(ebt)); Marshal.StructureToPtr(ebt, ptrStruct, false); System.Diagnostics.Debug.Assert(m_parent != null, "Parent control is null", "Set parent before calling Show"); int ret = SendMessage(m_parent.Handle, EM_SHOWBALLOONTIP, 0, ptrStruct); Marshal.FreeHGlobal(ptrStruct); }
/// <summary> /// Sends the specified message to a window or windows. The SendMessage function calls the window procedure for the specified window and does not return until the window procedure has processed the message. /// </summary> /// <param name="hWnd">A handle to the window whose window procedure will receive the message. If this parameter is HWND_BROADCAST ((HWND)0xffff), the message is sent to all top-level windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows; but the message is not sent to child windows.</param> /// <param name="Msg">The message to be sent.</param> /// <param name="wParam">Additional message-specific information.</param> /// <param name="balloonTip">Additional message-specific information.</param> /// <returns>The return value specifies the result of the message processing; it depends on the message sent.</returns> public static IntPtr SendMessage(HandleRef hWnd, EditMessage Msg, int wParam, ref EDITBALLOONTIP balloonTip) => User32_Gdi.SendMessage(hWnd, Msg, wParam, ref balloonTip);
public static extern IntPtr SendMessage(HWND hWnd, User32_Gdi.EditMessage Msg, int wParam, ref EDITBALLOONTIP balloonTip);
/// <summary> /// Show a balloon tooltip for edit control. /// </summary> public void Show() { EDITBALLOONTIP ebt = new EDITBALLOONTIP(); ebt.pszText = Text; ebt.pszTitle = Title; ebt.ttiIcon = (int)Icon; ebt.cbStruct = Marshal.SizeOf(ebt); SendMessage (Parent.Handle, EM_SHOWBALLOONTIP, 0, ref ebt); }
private static extern int SendMessage(IntPtr hWnd, uint msg, int wParam, ref EDITBALLOONTIP lParam);
/// <summary> /// Show a balloon tooltip for edit control. /// </summary> public void Show() { EDITBALLOONTIP ebt = new EDITBALLOONTIP(); ebt.cbStruct = Marshal.SizeOf(ebt); ebt.pszText = m_text; ebt.pszTitle = m_title; ebt.ttiIcon = (int)m_titleIcon; IntPtr ptrStruct = Marshal.AllocHGlobal(Marshal.SizeOf(ebt)); Marshal.StructureToPtr(ebt, ptrStruct, true); System.Diagnostics.Debug.Assert(m_parent!=null, "Parent control is null", "Set parent before calling Show"); int ret = SendMessage(m_parent.Handle, EM_SHOWBALLOONTIP, 0, ptrStruct); Marshal.FreeHGlobal(ptrStruct); }