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?
NvrBst
--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-