I have a richtextbox in an app and I'd like key words to be in another color, how can I do this?
Thanks Jade
C is a general-purpose language that most programmers learn before moving on to more complex languages. From Unix and Windows to Tic Tac Toe and Photoshop, several of the most commonly used applications today have been built on C. It is easy to learn because: A simple syntax with only 32 keywords.
In C programming language, %d and %i are format specifiers as where %d specifies the type of variable as decimal and %i specifies the type as integer. In usage terms, there is no difference in printf() function output while printing a number using %d or %i but using scanf the difference occurs.
Because a and b and c , so it's name is C. C came out of Ken Thompson's Unix project at AT&T. He originally wrote Unix in assembly language. He wrote a language in assembly called B that ran on Unix, and was a subset of an existing language called BCPL.
In the real sense it has no meaning or full form. It was developed by Dennis Ritchie and Ken Thompson at AT&T bell Lab. First, they used to call it as B language then later they made some improvement into it and renamed it as C and its superscript as C++ which was invented by Dr.
you can use:
richTextBox1.SelectionColor = Color.Yellow;
richTextBox1.SelectionBackColor = Color.Blue;
to select a text set:
richTextBox1.SelectionStart = text_position_in_editor (caret position)
richTextBox1.SelectionLength = text_length
then set SelectionColor ... (see all properties starting with Selection...)
Or, you can set directly the Rtf property (or richTextBox1.SelectedRtf)
which contains formatting info.
Type some text in WordPad, change it's formatting, copy and paste it into your RichTextBox, show the property Rtf value, you should be able to learn faster how to meet your needs.
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