Jump to content

Need some help with GUI Controls in C#


Info
 Share

Recommended Posts

Okay, three questions:

1. How do I make a richTextBox to read-only...?

2. I know that to insert a text to a control I need to:

this.richTextBox1.Text = "new text";

But how do I make new lines? (@CRLF in AutoIt)

3. How do I insert the green lines in the progress bar? (GUICtrlSetData ($Progress, 50) in AutoIt)

Thanks :)

Link to comment
Share on other sites

Are you wanting to have multiple lines of text from a single string, or add a new line to text that's already in the RichTextBox?

If you are wanting to have multiple lines of text from a single string, you can use the System.Enviroment.NewLine, or a simple "\n".

this.richTextBox1.Text = "new\ntext";

This example puts "new" on one line, and "text" on a new line.

To add new text to a RichTextBox, you can use the AppendText() method.

this.richTextBox1.AppendText("new text");

Note: If using AppendText(), and you want it to be on a new line, you need to add a "\n" to the beginning of the string:

this.richTextBox1.AppendText("\nnew text");
Edited by jhunt1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...