I am developing a character creator using Windows Forms (because apparently I can't create menus in Unity), and I want to display some tips and descriptions in a RichTextBoxRichTextBox located by the options when the user's mouse hover by it's GroupBoxesits GroupBoxes.
Since iI am fairly new to programming I don't know if getting all the controlscontrols' names one by one is the optimal, so I want to grab the controls' names inside of the tabControltabControl control that I am using to organize everything.
private void TabControl1_MouseHover(object sender, EventArgs e)
{
foreach(Control c in this.Controls)
{
string name = c.Name;
TooltipText(name);
}
}
And I also have a method where I will write the text that will be displayed in the RichTextBoxRichTextBox
private string TooltipText(string name)
{
if(name == "Name:")
{
return "blabla";
}
else
{
return "none";
}
}
I've tried a generic method to show a message box if the control was detected and, as I suspected, nothing showed up:
private void TooltipText(string name)
{
if(name == "LBL_Name")
{
MessageBox.Show("hey");
return;
}
}
How can iI properly detect the GroupboxesGroupBoxes or other types of Controlscontrols inside of the TabControlTabControl control and also display the text in the box beside it?