We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Handle the size of Tooltip in GDBG/CellTipText

Thread ID:

Created:

Updated:

Platform:

Replies:

23741 Jan 18,2005 07:12 PM UTC Jan 18,2005 08:29 PM UTC WinForms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On January 18, 2005 07:12 PM UTC

Hi Clay I found a sample in the dotnet newsgroup that handles the size of the Tooltip window. Is there a way to get the instance of the tooltip in GDBG when you''re displaying the tooltip. The sample gets the handle of the tooltip windows and sends a message. object o = typeof(ToolTip).InvokeMember("Handle",BindingFlags.NonPublic|BindingFlags.Instance|BindingFlags.GetProperty,null,myTooltip,null); IntPtr hwnd = (IntPtr) o; SendMessage(hwnd,0x0418, 0, 300); } Regards Thomas

Administrator [Syncfusion]
Replied On January 18, 2005 08:04 PM UTC

If you are deriving the GridDataBoundGrid, you can override protected override ToolTip CreateCellToolTip() { ToolTip tip = base.CreateCellToolTip(); return tip; } and get at the ToolTip. If you only need to set the size there, then that would be all you would need. If you want to set it dynamically as teh tool is displayed, you can save a reference to the tooltip in the override, an dthen use this reference in an OnActivateToolTip override or in the event.

Administrator [Syncfusion]
Replied On January 18, 2005 08:29 PM UTC

Hi Clay Thanks for the code. protected override ToolTip CreateCellToolTip() { ToolTip cellTip = base.CreateCellToolTip(); cellTip.SetToolTip( this, "T" ); cellTip.SetToolTip( this, string.Empty ); object handle = typeof(System.Windows.Forms.ToolTip).InvokeMember( "Handle",BindingFlags.NonPublic|BindingFlags.Instance|BindingFlags.GetProperty, null,cellTip,null); if( handle != null ) { IntPtr hwnd = (IntPtr)handle; SendMessage(hwnd,0x0418, 0, 300); } return cellTip; } The tooltip have to be set to an dummy value, otherwise the handle of the tooltip window is null and this causes an exception. Regards Thomas

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;