C++ RichTextBox Control.
The Windows C++ RichTextBox control allows users to enter and edit text using more advanced text formatting offered with the TextBox control. The RichTextBox control can load RFT format as well as TXT format files for reading or editing and provide methods for saving the edited files. The RichTextBox control can also be set to detect Url information and respond to the user clicking the Url.
Namespace: System::Windows::Forms
System.Windows.Forms (in system.windows.forms.dll)
Creating an new C++ Windows forms RichTextBox.
RichTextBox^ richbox = gcnew RichTextBox;
Assigning the Dock Style to the RichTextBox Control.
richbox->Dock = System::Windows::Forms::DockStyle::Fill;
Assigning a text value to the C++ RichTextBox control.
richbox->Text = "RichTextBox Text Area.";
Adding a C++ RichTextBox control to the form.
this->Controls->Add(richbox);
Assigning the RichTextBox SelectionStart and SelectionLength properties.
richbox->HideSelection = false;
richbox->SelectionStart = 0;
richbox->SelectionLength = 11;
Setting the BackColor for the RichTextBox Control.
richbox->BackColor = System::Drawing::Color::Beige;
Setting the Selected Font style.
richbox->SelectionFont = gcnew System::Drawing::Font(richbox->SelectionFont->FontFamily,richbox->Font->Size,System::Drawing::FontStyle::Bold );
|