Click here to Skip to main content
15,908,166 members
Home / Discussions / C#
   

C#

 
GeneralRe: Delete XmlNode Pin
Heath Stewart6-Feb-05 6:33
protectorHeath Stewart6-Feb-05 6:33 
GeneralRe: Delete XmlNode Pin
John L. DeVito8-Feb-05 12:01
professionalJohn L. DeVito8-Feb-05 12:01 
Questionhow to make what SelectionIndent does in tabs Pin
ektoras5-Feb-05 13:46
ektoras5-Feb-05 13:46 
AnswerRe: how to make what SelectionIndent does in tabs Pin
Heath Stewart6-Feb-05 6:29
protectorHeath Stewart6-Feb-05 6:29 
GeneralRe: how to make what SelectionIndent does in tabs Pin
ektoras14-Feb-05 0:59
ektoras14-Feb-05 0:59 
GeneralDifferent font colors in textbox Pin
MG00c2x5-Feb-05 11:47
MG00c2x5-Feb-05 11:47 
GeneralRe: Different font colors in textbox Pin
mav.northwind6-Feb-05 3:56
mav.northwind6-Feb-05 3:56 
GeneralRe: Different font colors in textbox Pin
sugunet7-Feb-05 1:38
sugunet7-Feb-05 1:38 
Yes, it can be easily done in a rich text box. Please read the following example.

The following example displays a ColorDialog to the user to specify a color for the current text selection or text entered after the current insertion point in a RichTextBox control. This example assumes that the method defined in the example is added to a Form class that contains a RichTextBox control named richTextBox1.
[Visual Basic]
Public Sub ChangeMySelectionColor()
Dim colorDialog1 As New ColorDialog()

' Set the initial color of the dialog to the current text color.
colorDialog1.Color = richTextBox1.SelectionColor

' Determine if the user clicked OK in the dialog and that the color has
' changed.
If (colorDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK) _
And Not(colorDialog1.Color.Equals(richTextBox1.SelectionColor)) Then

' Change the selection color to the user specified color.
richTextBox1.SelectionColor = colorDialog1.Color
End If
End Sub
[C#]
public void ChangeMySelectionColor()
{
ColorDialog colorDialog1 = new ColorDialog();

// Set the initial color of the dialog to the current text color.
colorDialog1.Color = richTextBox1.SelectionColor;

// Determine if the user clicked OK in the dialog and that the color has changed.
if(colorDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK &&
colorDialog1.Color != richTextBox1.SelectionColor)
{
// Change the selection color to the user specified color.
richTextBox1.SelectionColor = colorDialog1.Color;
}
}





Regards,
Sugandh
Generalnew line in string Pin
Majid Shahabfar5-Feb-05 10:29
Majid Shahabfar5-Feb-05 10:29 
GeneralRe: new line in string Pin
Beringer5-Feb-05 11:58
Beringer5-Feb-05 11:58 
GeneralRe: new line in string Pin
MG00c2x5-Feb-05 12:03
MG00c2x5-Feb-05 12:03 
GeneralRe: new line in string Pin
S. Senthil Kumar5-Feb-05 16:06
S. Senthil Kumar5-Feb-05 16:06 
GeneralRe: new line in string Pin
Majid Shahabfar6-Feb-05 6:07
Majid Shahabfar6-Feb-05 6:07 
GeneralRe: new line in string Pin
Jon Sagara5-Feb-05 18:52
Jon Sagara5-Feb-05 18:52 
GeneralRe: new line in string Pin
sugunet6-Feb-05 0:55
sugunet6-Feb-05 0:55 
GeneralRe: new line in string Pin
Majid Shahabfar6-Feb-05 6:05
Majid Shahabfar6-Feb-05 6:05 
GeneralRe: new line in string Pin
mav.northwind6-Feb-05 3:17
mav.northwind6-Feb-05 3:17 
GeneralRe: new line in string Pin
Majid Shahabfar6-Feb-05 6:03
Majid Shahabfar6-Feb-05 6:03 
GeneralRe: new line in string Pin
Luis Alonso Ramos6-Feb-05 7:29
Luis Alonso Ramos6-Feb-05 7:29 
GeneralRe: new line in string Pin
mav.northwind6-Feb-05 7:39
mav.northwind6-Feb-05 7:39 
GeneralWeb form from click event Pin
brian555-Feb-05 9:37
brian555-Feb-05 9:37 
GeneralRe: Web form from click event Pin
Heath Stewart6-Feb-05 6:22
protectorHeath Stewart6-Feb-05 6:22 
Questionhow to use mmioInstallIOProcA? Pin
[DK]KiloDunse5-Feb-05 7:16
[DK]KiloDunse5-Feb-05 7:16 
AnswerRe: how to use mmioInstallIOProcA? Pin
[DK]KiloDunse5-Feb-05 10:25
[DK]KiloDunse5-Feb-05 10:25 
GeneralMouse Tracking Pin
Beringer5-Feb-05 4:32
Beringer5-Feb-05 4:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.