ToolTips
-
In this class I have not found any possibility to bind the shown text to a property of an object... Maybe there is a possibility but I don't find any... Regards Hansjörg
-
In this class I have not found any possibility to bind the shown text to a property of an object... Maybe there is a possibility but I don't find any... Regards Hansjörg
-
hpetriffer wrote:
bind the shown text to a property of an object
Do you want to automatically update the text in both object property and tooltip? Write an event handler that updates them if the text changes? No hurries, no worries.
yes it seems that this is the only solution. But I have another problem with the tooltip. If I open a contextmenu of the object on which is displayed the standard tooltip (.net2.0). the tooltip is not displayed anymore. it is displayed only when I call SetToolTip another time... Regards Hansjörg
-
yes it seems that this is the only solution. But I have another problem with the tooltip. If I open a contextmenu of the object on which is displayed the standard tooltip (.net2.0). the tooltip is not displayed anymore. it is displayed only when I call SetToolTip another time... Regards Hansjörg
-
What do you mean with that exactly?
-
Hello, maybe someone here can help me. I need something like a tooltip. In this tooltip should be displayed a string. Til now it is not complicated. But the problem is that the string should be bind to an object and so automatically updated. Is this possible? is there something available on the whole web? Regards Hansjörg
hi, you can change the tool tip text when ever needed. toolTip1.SetToolTip(this.button1, "My button1"); the follwing was from an external help: The following code example creates an instance of the ToolTip class and associates the instance with the Form that the instance is created within. The code then initializes the delay properties AutoPopDelay, InitialDelay, and ReshowDelay. In addition the instance of the ToolTip class sets the ShowAlways property to true to enable ToolTip text to always be display regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a Button and a CheckBox. The code example requires that the method defined in the example is located within a Form that contains a Button control named button1 and a CheckBox control named checkBox1, and that the method is called from the constructor of the Form. Visual Basic ' This example assumes that the Form_Load event handling method ' is connected to the Load event of the form. Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles MyBase.Load ' Create the ToolTip and associate with the Form container. Dim toolTip1 As New ToolTip() ' Set up the delays for the ToolTip. toolTip1.AutoPopDelay = 5000 toolTip1.InitialDelay = 1000 toolTip1.ReshowDelay = 500 ' Force the ToolTip text to be displayed whether or not the form is active. toolTip1.ShowAlways = True ' Set up the ToolTip text for the Button and Checkbox. toolTip1.SetToolTip(Me.button1, "My button1") toolTip1.SetToolTip(Me.checkBox1, "My checkBox1") End Sub C# // This example assumes that the Form_Load event handling method // is connected to the Load event of the form. private void Form1_Load(object sender, System.EventArgs e) { // Create the ToolTip and associate with the Form container. ToolTip toolTip1 = new ToolTip(); // Set up the delays for the ToolTip. toolTip1.AutoPopDelay = 5000; toolTip1.InitialDelay = 1000; toolTip1.ReshowDelay = 500; // Force the ToolTip text to be displayed whether or not the form is active. toolTip1.ShowAlways = true; // Set up the ToolTip text for the Button and Checkbox. toolTip1.SetToolTip(this.button1, "My button1"); toolTip1.SetToolTip(this.checkBox1, "My checkBox1"); } C++ // This example assumes that the Form_Load event handling method // is connected to the Load event of the form. void Form1_Load( Object^ sender, System::EventArgs^ e ) {
-
What do you mean with that exactly?
you have a string eg. "my dynamic text". If this text should change, you'ld like to change the property of your object and of your tooltip? Do something like:
public void SetMyDynamicText(string input){ inmemorystring = input //UPDATE tooltip and property }
something like that, it's getting difficult without really knowing what you'ld like to do... good luck. No hurries, no worries. -
you have a string eg. "my dynamic text". If this text should change, you'ld like to change the property of your object and of your tooltip? Do something like:
public void SetMyDynamicText(string input){ inmemorystring = input //UPDATE tooltip and property }
something like that, it's getting difficult without really knowing what you'ld like to do... good luck. No hurries, no worries.Okay this I understand, this I can solve when I make an event OnDataChanged or something else, where I can change the text of the tooltip... But I don't understand til now, why the tooltip doesn't show the text anymore when I open a contextmenu on the same object (I do nothing there!) Regards Hansjrög
-
hi, you can change the tool tip text when ever needed. toolTip1.SetToolTip(this.button1, "My button1"); the follwing was from an external help: The following code example creates an instance of the ToolTip class and associates the instance with the Form that the instance is created within. The code then initializes the delay properties AutoPopDelay, InitialDelay, and ReshowDelay. In addition the instance of the ToolTip class sets the ShowAlways property to true to enable ToolTip text to always be display regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a Button and a CheckBox. The code example requires that the method defined in the example is located within a Form that contains a Button control named button1 and a CheckBox control named checkBox1, and that the method is called from the constructor of the Form. Visual Basic ' This example assumes that the Form_Load event handling method ' is connected to the Load event of the form. Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles MyBase.Load ' Create the ToolTip and associate with the Form container. Dim toolTip1 As New ToolTip() ' Set up the delays for the ToolTip. toolTip1.AutoPopDelay = 5000 toolTip1.InitialDelay = 1000 toolTip1.ReshowDelay = 500 ' Force the ToolTip text to be displayed whether or not the form is active. toolTip1.ShowAlways = True ' Set up the ToolTip text for the Button and Checkbox. toolTip1.SetToolTip(Me.button1, "My button1") toolTip1.SetToolTip(Me.checkBox1, "My checkBox1") End Sub C# // This example assumes that the Form_Load event handling method // is connected to the Load event of the form. private void Form1_Load(object sender, System.EventArgs e) { // Create the ToolTip and associate with the Form container. ToolTip toolTip1 = new ToolTip(); // Set up the delays for the ToolTip. toolTip1.AutoPopDelay = 5000; toolTip1.InitialDelay = 1000; toolTip1.ReshowDelay = 500; // Force the ToolTip text to be displayed whether or not the form is active. toolTip1.ShowAlways = true; // Set up the ToolTip text for the Button and Checkbox. toolTip1.SetToolTip(this.button1, "My button1"); toolTip1.SetToolTip(this.checkBox1, "My checkBox1"); } C++ // This example assumes that the Form_Load event handling method // is connected to the Load event of the form. void Form1_Load( Object^ sender, System::EventArgs^ e ) {
I know that solution, but here it is not possible to update the text of the tooltip automatically. The only solution to solve this is to generate an event OnDataChanged and then to update the ToolTip text...
-
Okay this I understand, this I can solve when I make an event OnDataChanged or something else, where I can change the text of the tooltip... But I don't understand til now, why the tooltip doesn't show the text anymore when I open a contextmenu on the same object (I do nothing there!) Regards Hansjrög
-
check if the
active
property is stilltrue
after the context menu, if it is I wouldn't know either :-( No hurries, no worries.I have set the property also to true in the contextmenu. But I saw alos that if I press ESC in the contextmenu the tooltip is not shown anymore :-((( Thanks for your help!!!