internal void UpdateTooltip(StatusBarPanel panel) { if (tooltips == null) { if (IsHandleCreated && !DesignMode) { //This shouldn't happen: tooltips should've already been set. The best we can //do here is reset it. tooltips = new ControlToolTip(this); } else { return; } } if (panel.Parent == this && panel.ToolTipText.Length > 0) { int border = SystemInformation.Border3DSize.Width; ControlToolTip.Tool t = tooltips.GetTool(panel); if (t == null) { t = new ControlToolTip.Tool(); } t.text = panel.ToolTipText; t.rect = new Rectangle(panel.Right-panel.Width + border, 0, panel.Width - border, Height); tooltips.SetTool(panel, t); } else { tooltips.SetTool(panel, null); } }
internal void UpdateTooltip(StatusBarPanel panel) { if (this.tooltips == null) { if (!base.IsHandleCreated || base.DesignMode) { return; } this.tooltips = new ControlToolTip(this); } if ((panel.Parent == this) && (panel.ToolTipText.Length > 0)) { int width = SystemInformation.Border3DSize.Width; ControlToolTip.Tool tool = this.tooltips.GetTool(panel); if (tool == null) { tool = new ControlToolTip.Tool(); } tool.text = panel.ToolTipText; tool.rect = new Rectangle((panel.Right - panel.Width) + width, 0, panel.Width - width, base.Height); this.tooltips.SetTool(panel, tool); } else { this.tooltips.SetTool(panel, null); } }