示例#1
0
        private void SetToolTip(AutoCompleteItem AutoCompleteItem)
        {
            var title = visibleItems[selectedItemIndex].ToolTipTitle;
            var text = visibleItems[selectedItemIndex].ToolTipText;

            if (string.IsNullOrEmpty(title))
            {
                toolTip.ToolTipTitle = null;
                toolTip.SetToolTip(this, null);
                return;
            }

            if (string.IsNullOrEmpty(text))
            {
                toolTip.ToolTipTitle = null;
                toolTip.Show(title, this, Width + 3, 0, 3000);
            }
            else
            {
                toolTip.ToolTipTitle = title;
                toolTip.Show(text, this, Width + 3, 0, 3000);
            }
        }
示例#2
0
 private void DoAutocomplete(AutoCompleteItem item, Range fragment)
 {
     string newText = item.GetTextForReplace();
     //replace text of fragment
     var tb = fragment.tb;
     tb.Selection.Start = fragment.Start;
     tb.Selection.End = fragment.End;
     tb.InsertText(newText);
     tb.Focus();
 }