32.28 How can I make sure I don't open a second instance modeless dialog that is already opened from my main form?


There are a several of ways to do this. Here are a few:

1) Insert a carriage return-linefeed, "\r\n", between your lines.

          textBox1.Text = "This is line 1.\r\nThis is line 2";
          // or textBox1.Text = stringvar1 + "\r\n" + stringvar2;

2) Use the Environment.NewLine property. This property is normally set to "\r\n".

          textBox1.Text = "This is line 1." + Environment.NewLine + "This is line 2";

3) Use the Lines property of the TextBox. Make sure you populate your array before you set the property.

          string[] arr = new string[2];
          arr[0] = "this is line1";
          arr[1] = "this is line 2";

          textBox3.Lines = arr;

© 2001-2010 Copyright Syncfusion Inc. All rights reserved.  |  Privacy Policy  |  Contact  |  Sitemap