Overloading Constructors with C# 08 July 2001 at 00:00
This is not the same as in Java. In C#, if you wish to overload constructors and you want one constructor to use another's functionality, you have to insert that constructor into your declaration.
public myClass() {
  MessageBox.Show("1");
}

public myClass(string strWhatever): this() {
  MessageBox.Show("2");
}
Order of execution is top down i.e. if you reference another constructor in your declaration it will run the code in that constructor first. In the above example, if you were to write the following code
myClass mc = new myClass("hello");
you would see a message box with the value "1" and then a message box with the value "2".
Invisible updates in a RichTextBox 08 July 2001 at 00:00

If, for example you are extending the RichTextBox class in order to create a text editor, you might want to change the colour of certain words in a line. however, in order to do this you need to "Select" the text you want to change, which results in the control flashing as the user types. This can be prevented by sending a message to windows telling it not to repaint the control.

I use the following two methods to achieve this - firstly calling the Lock method to prevent the updates from being visible, then doing my updates, and then calling the Unlock method which results in Windows repainting the control again (calling the Invalidate method). Both methods are specific to the RichTextBox control as they also aletr it's ReadOnly property before sending the update message.

  private void Lock() 
  {
    Message msg = Message.Create(this.Handle, 11, new System.IntPtr(0), new System.IntPtr(0));
    this.WndProc(ref msg);
    this.ReadOnly = true;
  }

  private void UnLock() 
  {
    this.ReadOnly = false;
    Message msg = Message.Create(this.Handle, 11, new System.IntPtr(1), new System.IntPtr(0));
    this.WndProc(ref msg);
    this.Invalidate();
  }