Note that there are some explanatory texts on larger screens.

plurals
  1. POAligning ToolTip To SelectedItemIndex of Intellisense
    primarykey
    data
    text
    <p>Here's the Scenario:</p> <p>I'm working on a code-editor (Winforms) and I use a <code>RichTextBox</code> and a component to serve as Intellisense .</p> <p>when pressing "." in <code>RichTextBox</code>, Intellisense will appear and every object inside of it has a different Tooltip .</p> <p>something like this:<br> <a href="http://oi44.tinypic.com/2lbzu1.jpg" rel="nofollow noreferrer">http://oi44.tinypic.com/2lbzu1.jpg</a></p> <p>now for the Tooltip Position was to follow <code>SelectedIndex</code> I came up with this code:</p> <pre><code>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 &gt;= 12) //still needed to fix { toolTip.ToolTipTitle = title; toolTip.Show(text, this, Width + 3, SelectedItemIndex + 165, 3000); } } </code></pre> <p>Problem was when Intellisense item reaches above 12 (take note that Intellisense has a filter that filters text (<code>startswith</code>) that been type in <code>Richtextbox</code> like Intellisense in visual studio) , it will automatically have a scroll (since it reach its max size) and the problem now was Tooltip will not follow its Selecteditemindex now when using the scroll .</p> <p>control intellisense was like a listbox .(since i mention earlier that its a component that i use)</p> <p>now my question was on how to make tooltip follow always the <code>SelectedItemIndex</code> of the intellisense .</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload