471,610 Members | 1,373 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,610 software developers and data experts.

ToolTip Show(...) Method - And External Objects

Hello. I'm trying to display a tooltip to an external window. I have a wrapper class
public class WindowWrapper : System.Windows.Forms.IWin32Window {
public WindowWrapper(IntPtr handle) { _hwnd = handle; }
public IntPtr Handle { get { return _hwnd; } }
private IntPtr _hwnd;

But when I call the following

ToolTip tt = new ToolTip();
tt.ShowAlways = true;
tt.Show("Hello", new WindowWrapper(hWnd), 100, 100);

I get a "NullObjectReference Exception" - Object reference not set to an instance of an object. at System.Windows.Forms.ToolTip.IsWindowActive(IWin32 Window window)

I can however call

MessageBox.Show(new WindowWrapper(hWnd), "Hello World!");

and a MessageBox shows fine. I can't even get ToolTip method (using show(..)) to work with non-external objects (using the WindowWrapper). Is there something I'm doing wrong or just can't do this with tooltips?

--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-

Jan 11 '06 #1
0 2531

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by runningdog | last post: by
2 posts views Thread by Alexander Bolotnov | last post: by
1 post views Thread by Paul Fairless | last post: by
2 posts views Thread by Paul E Collins | last post: by
4 posts views Thread by juergen | last post: by
10 posts views Thread by =?Utf-8?B?QWxiZXJ0IEZ1?= | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by CCCYYYY | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.