Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version
Go to top

Autocomplete Menu

, 1 Oct 2012
Customizable autocomplete menu for RichTextBox, TextBox and other controls
AutocompleteMenu-noexe.zip
AutocompleteMenu
AutocompleteMenu.suo
AutocompleteMenu
obj
Debug
AutocompleteMenuNS.AutocompleteMenu.resources
Properties
Tester
bin
Debug
Tester.vshost.exe.manifest
obj
x86
Debug
Tester.AdvancedSample.resources
Tester.ComboboxSample.resources
Tester.CustomItemSample.resources
Tester.CustomListViewSample.resources
Tester.DataGridViewSample.resources
Tester.DynamicMenuSample.resources
Tester.DynamicTooltipSample.resources
Tester.ExtraLargeSample.resources
Tester.MainForm.resources
Tester.MultiColumnSample.resources
Tester.Properties.Resources.resources
Tester.Sandbox.resources
Tester.SimplestSample.resources
Properties
Settings.settings
AutocompleteMenu.zip
AutocompleteMenu.suo
bin
Debug
AutocompleteMenu.dll
AutocompleteMenu.dll
AutocompleteMenuNS.AutocompleteMenu.resources
AutocompleteMenu.dll
Tester.exe
Tester.vshost.exe
Tester.vshost.exe.manifest
Tester.AdvancedSample.resources
Tester.ComboboxSample.resources
Tester.CustomItemSample.resources
Tester.CustomListViewSample.resources
Tester.DataGridViewSample.resources
Tester.DynamicMenuSample.resources
Tester.DynamicTooltipSample.resources
Tester.exe
Tester.ExtraLargeSample.resources
Tester.MainForm.resources
Tester.MultiColumnSample.resources
Tester.Properties.Resources.resources
Tester.Sandbox.resources
Tester.SimplestSample.resources
Settings.settings
AutocompleteMenuDemo.zip
AutocompleteMenuDemo
AutocompleteMenu.dll
Tester.exe
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using AutocompleteMenuNS;

namespace Tester
{
    public partial class ComboboxSample : Form
    {
        public ComboboxSample()
        {
            InitializeComponent();
            BuildAutocompleteMenu();
        }

        private void BuildAutocompleteMenu()
        {
            var items = new List<AutocompleteItem>();

            //get all classes and methods of Form's assembly
            foreach (var cl in Assembly.GetAssembly(typeof(Form)).GetTypes())
            {
                items.Add(new SubstringAutocompleteItem(cl.Name, false) {ImageIndex = 0});
                foreach(var method in cl.GetMethods())
                    items.Add(new SubstringAutocompleteItem(method.Name, false) { ImageIndex = 2, MenuText = cl.Name + "." + method.Name + "()" });
            }

            //set as autocomplete source
            autocompleteMenu1.SetAutocompleteItems(items);
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)

Share

About the Author

Pavel Torgashov

Ukraine Ukraine
I am Pavеl Tоrgаshоv, and I live in Kyiv, Ukraine.
I've been developing software since 1998.
Main activities: processing of large volumes of data, statistics, computer vision and graphics.
 
My contact email is p_torgashov[at]ukr.net

| Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 1 Oct 2012
Article Copyright 2012 by Pavel Torgashov
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid