My program dynamically builds lots of strings. Is there a way to optimize string performance

Use the StringBuilder class to concatenate strings. This class reuses memory. If you add string members to concatenate them, there is extra overhead as new memory is allocated for the new string. If you do a series of concatenations using the strings (instead of StringBuilder objects) in a loop, you continually get new strings allocated. StringBuilder objects allocate a buffer, and reuse this buffer in its work, only allocating new space when the initial buffer is consumed. Here is a typical use case. StreamReader sr = File.OpenText(dlg.FileName); string s = sr.ReadLine(); StringBuilder sb = new StringBuilder(); while (s != null) { sb.Append(s); s = sr.ReadLine(); } sr.Close(); textBox1.Text = sb.ToString();

In VB6, I used control arrays to have a common handler handle events from several controls. How can I do this in Windows Forms

You can specify events from different controls be handled by a single method. When you define your handler, you can list several events that are to be handled by listing them in the Handles argument. This statement handles three different textbox’s TextChanged event. Private Sub TextsChanged(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles TextBox1.TextChanged, TextBox2.TextChanged, TextBox3.TextChanged In the TextsChanged handler, you may need to identify the particular control that fired the event. This sender parameter holds the control. You can use it with code such as: Dim eventTextBox as TextBox = sender

The MessageBox always appears in the center of the screen. How can I change it’s location

Its looks like you cannot change this behavior of MessageBox. One solution is to derive your own MessageForm class from Form to display your message. Then call its ShowDialog method to show it after you set its Size, Location and StartPosition properties. (If you don’t set the StartPosition , then the Location is ignored.) One of the values for StartPosition is CenterParent which would center your new MessageForm.