2
我有一個窗體窗體應用程序,其中一些控件首先隱藏並在某些情況下可見。 有時候工具提示氣球不可見。 我有以下構造函數代碼,工具提示氣球沒有顯示在獲勝形式的控件
ToolTip toolTipBalloon;
toolTipBalloon.AutoPopDelay = 15000;
toolTipBalloon.InitialDelay = 1500;
toolTipBalloon.IsBalloon = true;
toolTipBalloon.ReshowDelay = 100;
toolTipBalloon.ToolTipTitle = "Setting";
toolTipBalloon.Popup += new System.Windows.Forms.PopupEventHandler(this.toolTipBalloon_Popup);
在事件處理程序:
private void toolTipBalloon_Popup(object sender, PopupEventArgs e)
{
// Set title of tooltip to control's accessible name or text
Control ctrl = e.AssociatedControl;
if (!String.IsNullOrEmpty(ctrl.AccessibleName))
toolTipBalloon.ToolTipTitle = ctrl.AccessibleName;
else if (!String.IsNullOrEmpty(ctrl.Text))
toolTipBalloon.ToolTipTitle = ctrl.Text;
}
我已經爲表單中的所有控件添加了此代碼。但是有時候工具提示氣球即將到來。 – Ravindra
@Ravindra你是什麼意思的「來」?我不確定你的實際問題是誠實的,對不起。你可以試着給出更詳細的解釋嗎? –
我在表單構造函數中分配了toolTipBallon.SetToolTip(chkBoxName,「Hello」)。此複選框控件在第一次不會顯示。基於某些條件,複選框控件將可見。這個工具提示氣球不會每次都來。某些時候,控制節目不會顯示工具提示框。我不確定爲什麼這樣發生。 – Ravindra