Present() public méthode

public Present ( Control control, string text ) : void
control Control
text string
Résultat void
Exemple #1
0
        // Called from timer (with only_refresh = false)
        // Called from ToolTipStart if tooltip is already shown (with only_refresh = true)
        public void ToolTipShow(bool only_refresh)
        {
            if (!form.Visible)
            {
                return;
            }

            string text = Locale.GetText(tooltip_hovered_button.Caption.ToString());

            tooltip_timer.Interval = tooltip_hide_interval;
            tooltip_timer.Enabled  = true;

            if (only_refresh && (tooltip == null || !tooltip.Visible))
            {
                return;
            }

            if (tooltip == null)
            {
                tooltip = new ToolTip.ToolTipWindow();
            }
            else if (tooltip.Text == text && tooltip.Visible)
            {
                return;
            }
            else if (tooltip.Visible)
            {
                tooltip.Visible = false;
            }

            if (form.WindowState == FormWindowState.Maximized && form.MdiParent != null)
            {
                tooltip.Present(form.MdiParent, text);
            }
            else
            {
                tooltip.Present(form, text);
            }
        }