2011-03-01 17 views

cevap

0

Tamam, o zaman belki bu (found here):

private void richTextBox1_MouseClick(object sender, MouseEventArgs e, Color color) 
{ 
    int firstcharindex = richTextBox1.GetFirstCharIndexOfCurrentLine(); 
    int currentline = richTextBox1.GetLineFromCharIndex(firstcharindex); 
    string currentlinetext = richTextBox1.Lines[currentline]; 
    richTextBox1.SelectionBackColor = color; 
    richTextBox1.Select(firstcharindex, currentlinetext.Length); 
} 

, o zaman rengini ayarlamak zorunda bu pasajı sorununuzu ;-) Hayır, ilk satırı seçmek zorunda

1

çözmek gerekir Büyük resim için:

public void MarkSingleLine() 
{ 
    int firstCharOfLineIndex = myRichTextBox.GetFirstCharIndexOfCurrentLine(); 
    int currentLine = richTextBox1.GetLineFromCharIndex(firstCharOfLineIndex); 
    this.myRichTextBox.Select(firstCharOfLineIndex, currentLine); 
    this.myRichTextBox.SelectionBackColor = Color.Aqua; 
    this.myRichTextBox.Select(0, 0); 
} 
İlgili konular