void cntl_MouseEnter(object sender, EventArgs e)
{
string desc = string.Empty;
Control mainControl = (Control)sender;
Control cntl = mainControl;
while ((cntl != null) && !(cntl is BaseField))
cntl = cntl.Parent;
if (cntl == null)
return;
// Set description for control
desc = ((BaseField)cntl).description;
// If control is checkbox, see if there is an individual checkbox description.
if (mainControl is CheckBox)
{
int bit = int.Parse(mainControl.Tag.ToString());
switch (cntl.Name.ToString())
{
case "Bitmask":
string temp = ((Bitmask)cntl).Options[bit].description;
desc = temp;
break;
}
}
if (desc != null && desc != string.Empty)
showInfoBox(mainControl.Text.ToUpper() + ":" + Environment.NewLine + desc, 0);
}