3

I want to insert a textbox into a window form so I chose FastColoredTextbox(this). It's a user-control which can be used to make a textblock component that's very similar to the one in a text editor.

I've been trying to get it to work and have done everything I could with my limited knowledge (started winforms a few days ago)

After installing the NuGet package, I tried getting it to work but I am not even able to start. I need help getting started.

  • I checked if it had the relevant assembly reference and it did.
  • I expected a component like a button/label to appear in my toolbox which I could drag into my designer but it didn't, so I tried rebuilding and changed settings to see if it appeared in the toolbox as given here. I didn't see anything in the toolbox that I could drag and drop.
  • I downloaded a sample project and went through the code. The designer.cs file had the variable and code for the textbox. I modified and pasted it into my designer.cs file thinking that it would appear in my designer. Visual Studio gave me a warning that the changes I make in the designer appear here and I shouldn't directly edit it.
  • There's no documentation to display the textbox. There's documentation for syntax highlighting, code folding etc.
  • I tried googling "how to use custom user-components" and I got links detialing the process of making a custom component.

If you need anymore details please let me know.
Help is greatly appreciated :)

Community
  • 1
  • 1
Abhirath Mahipal
  • 938
  • 1
  • 10
  • 21
  • 1
    It would be great if NuGet referenced assemblies showed up automatically. Please leave a comment here so that this issue gets visibility: https://github.com/NuGet/Home/issues/3509#issuecomment-337100601 – jnm2 Nov 25 '17 at 18:28
  • 1
    I have sunk half a week into a workaround you might find useful for the present: https://github.com/NuGet/Home/issues/3509#issuecomment-347621114 – jnm2 Nov 28 '17 at 18:39
  • @jnm2 That's awesome. Good luck. – Abhirath Mahipal Nov 29 '17 at 02:52

1 Answers1

3

Since you are using a nuget package (Install-Package FCTB), the control is in this dll:

Solution Directory → packages → FCTB.2.16.11.0 → lib → FastColoredTextBox.dll

You can add the control to Toolbox and drop in on the form and simply assign some text to Text property of control.

To add the control to toolbox, just right click on a group in Toolbox and click Choose Items ..., then from .NET Framework Components tab use Browse... button to choose FastColoredTextBox.dll from this path:

Solution Directory → packages → FCTB.2.16.11.0 → lib → FastColoredTextBox.dll

After choosing the dll, press OK to add FastColoredTextBox control to the toolbox. Then simply drop an instance on form and in code, assign a text to it's Text property:

this.fastColoredTextBox1.Text = "Some Text";
Reza Aghaei
  • 120,393
  • 18
  • 203
  • 398