Tooltips of tree view on tool window.

Docking/MDI for Windows Forms Forum

Posted 10 years ago by Michael Knorr
Version: 2.0.0105
Avatar
Hi,

usually when you have a node in a tree view with a node title that is wider than the tree view itself and you hover over that node a tooltip is shown, so you can see the whole node title. However when I place a tree view on a ActiPro UIToolWindow, the tool tip is shown behind the application.

To reproduce it take the sample app, replace one of the property grids with a tree view and add some nodes with long titles. Now dock this tool window on the right. When you hover over the tree nodes the tooltips show behind the window.

Any idea how I can get the tooltips to show in front of the tool window?

Regards,
Michael Knorr

Comments (2)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Michael,

We've seen that issue before but never found a good way around it. However it may not be our issue, rather a bug with Microsoft's code. Since UIStudio's docking controls at their core simply using Forms, where some Forms has tool window style and are owned by the main host Form, my guess is that you could reproduce the same issue without using our product and just using plain Forms in a similar setup.


Actipro Software Support

Posted 10 years ago by Michael Knorr
Avatar
Hi,

just found this bug is described in the Microsoft Knowledge Base (Article number Q241102
http://support.microsoft.com/?scid=kb%3Ben-us%3B241102&x=18&y=14). In C# one can
fix it by adding the following code to the tree view:

private const int TVS_NOTOOLTIPS = 0x80;
private const int GWL_STYLE = -16;

[DllImport("user32.dll")]
public static extern long GetWindowLong(IntPtr hWnd, int nIndex);

[DllImport("User32.Dll")]
public static extern long SetWindowLong(IntPtr hwnd, int index, long newValue);


protected override void OnVisibleChanged(EventArgs e)
{
  base.OnVisibleChanged(e);

  long dwStyle = GetWindowLong(this.Handle, GWL_STYLE);
  SetWindowLong(this.Handle, GWL_STYLE, dwStyle | TVS_NOTOOLTIPS);
  SetWindowLong(this.Handle, GWL_STYLE, dwStyle & ~TVS_NOTOOLTIPS);
}
Regards,
Michael
The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.