|
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.
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.