的SelectedItemIndex這裏的情景:對齊工具提示智能感知
我工作的一個代碼編輯器(的WinForms),我用一個RichTextBox
和組件作爲智能感知。
當按下 「」在RichTextBox
中,智能感知將出現並且其內部的每個對象都有不同的工具提示。
是這樣的:
http://oi44.tinypic.com/2lbzu1.jpg
工具提示位置是按照SelectedIndex
我想出了這個代碼:當智能感知項目達到12以上(需注意,
public void SetToolTip(Intellisense intellisenseitem)
{
if (selectedItemIndex == 0)
{
toolTip.ToolTipTitle = title;
toolTip.Show(text, this, Width + 3, SelectedItemIndex, 3000);
}
if (selectedItemIndex == 1)
{
toolTip.ToolTipTitle = title;
toolTip.Show(text, this, Width + 3, SelectedItemIndex + 15, 3000);
}
if (selectedItemIndex == 2)
{
toolTip.ToolTipTitle = title;
toolTip.Show(text, this, Width + 3, SelectedItemIndex + 30, 3000);
}
if (selectedItemIndex == 3)
{
toolTip.ToolTipTitle = title;
toolTip.Show(text, this, Width + 3, SelectedItemIndex + 45, 3000);
}
if (selectedItemIndex == 4)
{
toolTip.ToolTipTitle = title;
toolTip.Show(text, this, Width + 3, SelectedItemIndex + 60, 3000);
}
if (selectedItemIndex == 5)
{
toolTip.ToolTipTitle = title;
toolTip.Show(text, this, Width + 3, SelectedItemIndex + 75, 3000);
}
if (selectedItemIndex == 6)
{
toolTip.ToolTipTitle = title;
toolTip.Show(text, this, Width + 3, SelectedItemIndex + 90, 3000);
}
if (selectedItemIndex == 7)
{
toolTip.ToolTipTitle = title;
toolTip.Show(text, this, Width + 3, SelectedItemIndex + 105, 3000);
}
if (selectedItemIndex == 8)
{
toolTip.ToolTipTitle = title;
toolTip.Show(text, this, Width + 3, SelectedItemIndex + 120, 3000);
}
if (selectedItemIndex == 9)
{
toolTip.ToolTipTitle = title;
toolTip.Show(text, this, Width + 3, SelectedItemIndex + 135, 3000);
}
if (selectedItemIndex == 10)
{
toolTip.ToolTipTitle = title;
toolTip.Show(text, this, Width + 3, SelectedItemIndex + 150, 3000);
}
if (selectedItemIndex == 11)
{
toolTip.ToolTipTitle = title;
toolTip.Show(text, this, Width + 3, SelectedItemIndex + 165, 3000);
}
if (selectedItemIndex >= 12) //still needed to fix
{
toolTip.ToolTipTitle = title;
toolTip.Show(text, this, Width + 3, SelectedItemIndex + 165, 3000);
}
}
問題智能感知有一個過濾器,過濾文本(startswith
),其一直類型Richtextbox
像智能感知在Visual Studio) ,它會自動有一個滾動(因爲它達到其最大尺寸)01現在,問題是,當使用滾動 工具提示將不會跟隨其Selecteditemindex現在。
控制智能感知就像一個列表框。(因爲我前面提到的,我使用的組件)
現在我的問題是如何讓工具提示始終遵循的智能感知的SelectedItemIndex
。
任何建議,先生,我該怎麼辦了滾動的解決方案嗎? – Elegiac
+1先生,如果你能幫助我如何解決這個問題的滾動生病接受這個答案 – Elegiac
看到我的編輯您的解決方案。 – Jegan