473,320 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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?

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

Jan 11 '06 #1
0 2596

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: runningdog | last post by:
Hi, I have created a number of Windows Forms Controls that require tooltips. If I add a tooltip object to each of my controls will this create any resource/performance issues that I should be...
2
by: mark | last post by:
I am developing an application in .Net C# that needs to restore a number of tool windows to some previous location and size. The problem I have is that when I create the form and set the Location...
2
by: Alexander Bolotnov | last post by:
Good day to everyone, I am trying to make a ToolTip for a couple of TextBoxes. What I do is: create a new ToolTip and make it a Balloon: ToolTip myToolTip = new ToolTip();...
1
by: Paul Fairless | last post by:
Could someone please explain how I overload the Show() method of a form? Suppose I select a record from a datagrid on Form1, then I want to show the details of the selected record by opening...
2
by: Paul E Collins | last post by:
How can I show a tooltip programmatically? I want to make it appear over a particular control at the specific time I choose, and not rely on the user's mouse movements. I don't mind using some...
4
by: juergen | last post by:
Hello everyone, I want to display a help text when in help mode in my application. Something like a tooltip. Now my application is a taskbar deskband and so not everything works what normally...
3
by: Amanda | last post by:
Can anyone help me to display the output in MessageBox for the following program result?...
10
by: =?Utf-8?B?QWxiZXJ0IEZ1?= | last post by:
Hi, my function: myAdjustForm.Show(); I am using the Show method to show the pop-up window to the users in my C# program. I found that I have invoke this function TWICE at the beginning...
8
by: shwethatj | last post by:
How to use MessageBox.Show() method in ASP.NET I mean what namespace should be added...?
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.