protected override void OnMouseHover(EventArgs e) { base.OnMouseHover(e); bool b = false; TypeIcons p = this.Parent as TypeIcons; if (p != null && p.lblTooltips != null) { Type t = this.Tag as Type; if (t != null) { DescriptionAttribute desc = TypeDescriptor.GetAttributes(t)[typeof(DescriptionAttribute)] as DescriptionAttribute; if (desc != null) { if (!string.IsNullOrEmpty(desc.Description)) { p.lblTooltips.Text = desc.Description; p.lblTooltips.Left = (p.lblTooltips.Parent.ClientSize.Width - p.lblTooltips.Width) / 2; b = true; } } } p.lblTooltips.Visible = b; } }
protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); this.Selected = false; this.BorderStyle = BorderStyle.None; TypeIcons p = this.Parent as TypeIcons; if (p != null && p.lblTooltips != null) { p.lblTooltips.Visible = false; } this.Refresh(); }
void tabControl1_SelectedIndexChanged(object sender, System.EventArgs e) { if (tabControl1.SelectedTab != null) { for (int i = 0; i < tabControl1.SelectedTab.Controls.Count; i++) { TypeIcons ti = tabControl1.SelectedTab.Controls[i] as TypeIcons; if (ti != null) { ti.LoadIcons(); break; } else { GreekLetters gk = tabControl1.SelectedTab.Controls[i] as GreekLetters; if (gk != null) { gk.LoadData(); } } } } }