Good morning everyone.
I would like to know if there is some way I can get the information froma variable "text" and assign
it to the text property value of a tooltiop on my main form.
Basically, I have created a small application that functions as a systray application. When the user
hovers over the notify icon I would like the tooltip to be information that is currently in a variable called
"statusInfo"
any information would be greatly appreciated.
Thank you!!
Bob
Loading
Mihir SolankiPosted Aug 3, 2005, 3:21 PM
i.e
"SomeText" + Environment.NewLine + "SomeMoreText"
Bob BPosted Aug 3, 2005, 2:16 PM
One more question...
Is there any way using excape characters to make the tooltip window be multi-line? Or any other method for that matter?
Thanks,
Bob
Bob BPosted Aug 3, 2005, 1:02 PM
Ok, I'm still missing something here.
I can very easily set the text property of the notify icon within design view but I don't believe this
will work for me. How can I set variable information within the text string as well. I tried to put the following
in to the "Text" location
"State " + currentState
But when doing this I just end up with a ToolTip of "State " + currentState (in plain text form). It is not reading
my variable information of currentState.
Thanks,
Bob
Mihir SolankiPosted Aug 3, 2005, 12:45 PM
Bob BPosted Aug 3, 2005, 12:30 PM
Ok,
I tried to add this code to the constructor of my main for and received multiple errors.
I have 2 variables I am working with.
string "status"
string "reason"
I have created a new variable called combinedStatus of type string
My goal is to do the following.
when the mouse pointer hovers over the notify icon (in the systray) for my main form application I would like the tooltip
to display the information (text) contained in the variable called combinedStatus
--where---
combinedStatus = "You are currently in " + status + " with a reason of " + reason;
Errors I am getting:
C:\Documents and Settings\rboursaw\My Documents\Visual Studio Projects\2004\ECSAgentDesktop\ECSAgentDesktop\AgentForm.cs(61): An object reference is required for the nonstatic field, method, or property 'ECSAgentDesktop.AgentForm.state
C:\Documents and Settings\rboursaw\My Documents\Visual Studio Projects\2004\ECSAgentDesktop\ECSAgentDesktop\AgentForm.cs(213): The best overloaded method match for 'System.Windows.Forms.ToolTip.SetToolTip(System.Windows.Forms.Control, string)' has some invalid arguments
Any thoughts?
Mihir SolankiPosted Aug 3, 2005, 11:14 AM
Try
new ToolTip();ToolTip t =
t.SetToolTip(TheControl,"TextUWantToSet");