更改RichTextBox的行和列的字符

时间:2015-08-02 12:03:08

标签: c# richtextbox

我需要更改RichTextBox中的字符,我可以在row_textbox和column_textbox中放置一个整数,然后我可以更改该行和列中的字符。这里是示例代码:

         //declarations
        int row = Int16.Parse(tbox_row.Text);
        int column = Int16.Parse(tbox_column.Text);
        // Get the row
        row = richTextBox1.SelectionStart;
        int row_rb = richTextBox1.GetLineFromCharIndex(row);

        // Get the column.
        column = richTextBox1.GetFirstCharIndexFromLine(row);
        int column_rb = row - column;

        tbox_sample.Text = "line: " + row.ToString() + ", column: " + column.ToString();

0 个答案:

没有答案