Pregunta

¿Hay una manera elegante para establecer ficha personalizada de tamaños / posiciones en un cuadro de texto de varias líneas en C #?

¿Fue útil?

Solución

Es necesario enviar el EM_SETTABSTOPS mensaje, de esta manera:

static class NativeMethods {
    [DllImport("user32.dll")]
    public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, ref int lParam);
}
static void SetTabs(TextBox box) {
    //EM_SETTABSTOPS - http://msdn.microsoft.com/en-us/library/bb761663%28VS.85%29.aspx
    int lParam = 16;  //Set tab size to 4 spaces
    NativeMethods.SendMessage(box.Handle, 0x00CB, new IntPtr(1), ref lParam);
    box.Invalidate();
}

Otros consejos

Además de por vb 2013 la gente amable de Microsoft han decidido que ya no necesita manejar las ventanas y ya no se puede llegar a ella.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top