Alsing.Windows.Forms.SyntaxBox.AutoListForm.Add C# (CSharp) Method

Add() public method

public Add ( string text, string InsertText, string ToolTip, int ImageIndex ) : ListItem
text string
InsertText string
ToolTip string
ImageIndex int
return ListItem
        public ListItem Add(string text, string InsertText, string ToolTip, int
                                                                                ImageIndex)
        {
            var li = new ListItem(text, ImageIndex, "", InsertText);
            LB.Items.Add(li);
            li.ToolTip = ToolTip;
            //this.LB.Sorted =true;
            return li;
        }

Same methods

AutoListForm::Add ( string text, int ImageIndex ) : ListItem
AutoListForm::Add ( string text, string InsertText, int ImageIndex ) : ListItem

Usage Example

Example #1
0
        private void CreateAutoList()
        {
            if (_SyntaxBox != null && !_SyntaxBox.DisableAutoList &&
                _AutoList == null)
            {
                Debug.WriteLine("Creating Autolist");

                AutoList = new AutoListForm();
                NativeMethods.SetWindowLong(AutoList.Handle,
                                            NativeMethods.GWL_STYLE,
                                            NativeMethods.WS_CHILD);

                AutoList.SendToBack();
                AutoList.Visible = false;
                //this.Controls.Add (this.AutoList);
                AutoList.DoubleClick += AutoListDoubleClick;

                AutoList.Images = _SyntaxBox.AutoListIcons;
                AutoList.Add("a123", "a123", "Some tooltip for this item 1", 1);
                AutoList.Add("b456", "b456", "Some tooltip for this item 2", 2);
                AutoList.Add("c789", "c789", "Some tooltip for this item 3", 2);
                AutoList.Add("d012", "d012", "Some tooltip for this item 4", 3);
                AutoList.Add("e345", "e345", "Some tooltip for this item 5", 4);
            }
        }