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. Image for the cookie policy date
close icon

Handle the size of Tooltip in GDBG/CellTipText

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

2 Replies

AD Administrator Syncfusion Team 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.

AD Administrator Syncfusion Team 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

Live Chat Icon For mobile
Up arrow icon