0

I've already made a function on the form that stings all the text I need into one string. Now how can I get that string to add to the main form's Rich textbox, rather then "set" the text in it using TextBoxExample.AppendText(Environment.NewLine + string);?

The string in question is commitAddRule. Below the Code i have tried so far:


public void OKButton_Click(object sender, EventArgs e)
{
        StringBuilder sb = new StringBuilder();
        if (!string.IsNullOrWhiteSpace(TexRedComment.Text))
        {
            sb.AppendLine("\n");
        }
        if (!string.IsNullOrWhiteSpace(TexRedComment.Text))
        {
            sb.AppendLine("[TextureRedefine] " + TexRedComment.Text);
        }
        else
        {
            sb.AppendLine("[TextureRedefine] ");
        }
        if (!string.IsNullOrWhiteSpace(WidthBox.Text))
        {
            sb.AppendLine("width = " + WidthBox.Text);
        }
        if (!string.IsNullOrWhiteSpace(HeightBox.Text))
        {
            sb.AppendLine("height = " + HeightBox.Text);
        }
        if (!string.IsNullOrWhiteSpace(FormatsBox.Text))
        {
            sb.AppendLine("formats = " + FormatsBox.Text);
        }
        if (!string.IsNullOrWhiteSpace(ExcludeFormats.Text))
        {
            sb.AppendLine("formatsExcluded = " + ExcludeFormats.Text);
        }
        if (!string.IsNullOrWhiteSpace(RenderWidth.Text))
        {
            sb.AppendLine("overwriteWidth = " + RenderWidth.Text);
        }
        if (!string.IsNullOrWhiteSpace(RenderHeight.Text))
        {
            sb.AppendLine("overwriteHeight = " + RenderHeight.Text);
        }
        if (!string.IsNullOrWhiteSpace(OverwriteFormatBox.Text))
        {
            sb.AppendLine("overwriteFormat = " + OverwriteFormatBox.Text);
        }
        var commitAddRule = sb.ToString(); 
}
Zoro
  • 1
  • 1

0 Answers0