So I'm working on a C# program that functions something like an IDE. The thing is, I'm doing it through a rich text box the custom syntax highlighting is SUPER inefficient.
I was wondering if there was a way to make a custom control similar to a rich text box (even based off of one) and then build in the syntax highlighting in an easier way...
So, how do I make custom controls? And if you were super nice, you'd point me in the direction of a good tutorial on it!
A software routine that adds some enhancement or feature to an application. Custom controls are written to provide as little as a few graphical interface improvements to as much as providing full imaging, spreadsheet and text editing extensions to the application.
Add the control by drawing Select the control by clicking on it. In your form, drag-select a region. The control will be placed to fit the size of the region you selected.
Simple but functional examples:
Windows Forms:
http://www.codeproject.com/KB/miscctrl/cutebutton.aspx
WPF:
http://msdn.microsoft.com/en-us/library/cc295235.aspx
easily just derive from base control
public class CustomRichTextBox:RichTextBox
{
public CustomRichTextBox()
{
this.Multiline = true;
this.WordWrap = false;
this.AcceptsTab = true;
//...
}
}
I would suggest looking at some tutorials such as
http://www.codeproject.com/KB/miscctrl/cutebutton.aspx
As NavidRahmani said just above, you dont have to start from scratch you can extend existing control or use controls that are already made from different libraries.
Such as telerik controls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With