Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

How do I send an EM_XXXX message to a TextBox to get some value such as line index in C#?

There is a protected SendMessage call you can use for this purpose, so you have to derive from TextBox.

public class CustomTextBox : TextBox
{
  private const int EM_XXXX = 0x1234;
  public int LineIndex { get { return base.SendMessage( EM_XXXX, 0, 0 ); } }
}

Shawn Burke, Microsoft



Page view counter