Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Eu estou desenvolvendo um programa chamado Raspy Studio(Ele é feito em Csharp com windows forms), ele é basicamente um editor de código leve feito para rodar em pc's fracos, e ele já tem vários recursos com Syntax Highlight e etc, mas eu estou pensando em fazer uma grande atualização nele com vários recursos novos, e um deles é o sistema de auto-completar.

[Edit by 0x1AA, google translate]
I am developing a program called Raspy Studio (It is made in Csharp with windows forms), it is basically a lightweight code editor made to run on weak PC's, and it already has several features with Syntax Highlight and etc, but I am thinking to do a major update on it with several new features, one of which is the auto-complete system.

What I have tried:

Ultimamente eu estava procurando por FastColoredTextBox aqui no CodeProject e achei um cara mostrando cada recurso da FastColoredTextBox e um deles era o auto-completar mas não tinha nenhum exemplo de como fazer, se você poder me ajudar com isso eu vou colocar seu nome(Do seu perfil do CodeProject) nos créditos e agradecimentos do programa!

[Edit by 0x1AA, google translate]
Lately I was looking for FastColoredTextBox here on CodeProject and I found a guy showing each feature of FastColoredTextBox and one of them was the auto-completion but there was no example of how to do it, if you can help me with that I will put your name (From yours CodeProject profile) in the program credits and thanks!
Posted
Updated 17-Dec-20 19:17pm
v2
Comments
[no name] 27-Aug-20 18:09pm    
This is an English language forum. Please write in English ;)
Garth J Lancaster 27-Aug-20 23:39pm    
I'm sure you meant "Este é um fórum em inglês. Por favor, escreva em inglês ;)" :)
Afzaal Ahmad Zeeshan 27-Aug-20 21:37pm    
And the problem with the new features is?

If you are interested in learning more about a sample from one of the articles, please ask the question under the article; QA is off-topic for article discussions.

1 solution

Okay, given you are new to forum, I looked.

Article in discussion seems to be: Fast Colored TextBox for Syntax Highlighting[^]

There are samples for it. Sample usage of autocomplete:
C#
public partial class AutocompleteSample : Form
{
    FastColoredTextBoxNS.AutocompleteMenu popupMenu;

    public AutocompleteSample()
    {
        InitializeComponent();

        //create autocomplete popup menu
        popupMenu = new FastColoredTextBoxNS.AutocompleteMenu(fctb);
        popupMenu.MinFragmentLength = 2;

        //generate 456976 words
        var randomWords = new List<string>();
        int codeA = Convert.ToInt32('a');
        for (int i = 0; i < 26; i++)
        for (int j = 0; j < 26; j++)
        for (int k = 0; k < 26; k++)
        for (int l = 0; l < 26; l++)
            randomWords.Add(
                new string(new char[]{Convert.ToChar(i + codeA), Convert.ToChar(j + codeA), Convert.ToChar(k + codeA), Convert.ToChar(l + codeA)}));

        //set words as autocomplete source
        popupMenu.Items.SetAutocompleteItems(randomWords);
        //size of popupmenu
        popupMenu.Items.MaximumSize = new System.Drawing.Size(200, 300);
        popupMenu.Items.Width = 200;
    }

    private void fctb_KeyDown(object sender, KeyEventArgs e)
    {
        if (e.KeyData == (Keys.K | Keys.Control))
        {
            //forced show (MinFragmentLength will be ignored)
            popupMenu.Show(true);
            e.Handled = true;
        }
    }
}

There is a folder called 'tester' in one of the download attachment zip. It contains all the samples. Try out!
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900