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

Add() public method

Adds a new ListItem to the AutoListForm.
public Add ( string text, int ImageIndex ) : ListItem
text string Text of the new ListItem
ImageIndex int Image index that should be assigned to the new ListItem
return ListItem
        public ListItem Add(string text, int ImageIndex)
        {
            return Add(text, text, ImageIndex);
        }

Same methods

AutoListForm::Add ( string text, string InsertText, int ImageIndex ) : ListItem
AutoListForm::Add ( string text, string InsertText, string ToolTip, 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);
            }
        }