ToolTip in SpecificText inside RichTextBox using MouseOver

im is working on a code editor and they are just wondering how to make a tooltip in the text, as it is commonly used in C # tools with mouse function. something like that:

enter image description here

senario sample,

when I type “abc” in richtextbox and hover over it, a tooltip appears with the message “this is the alphabet”. same as with “123” entered in richtextbox, and hover “this number will appear”.

anyway, can i do this? without flooding or with any keystroke? just a mouseover in the text? Thanks, I really need help.

0
source share
1 answer

Try this code:

private void richTextBox1_MouseHover(object sender, EventArgs e) { double x; if (double.TryParse(richTextBox1.Text, out x)) { toolTip1.Show(this is a number will appear",richTextBox1); } else { toolTip1.Show("this is an alphabet",richTextBox1); } } 
+1
source

Source: https://habr.com/ru/post/1498303/


All Articles