Ho trovato la soluzione. Dato che potrebbe essere utile ad altri, la incollo qui di seguito:
L'ho provato, e funziona alla perfezioneOn the newsgroup somebody asked how to have multiple lines of text on a .NETCF Button control. The native control supports this but the appropriate style is not set by default. The following code snippet shows how to enable this:-
The usage is simple, just pass the specific Button control to MakeButtonMultiline:-codice:private const int BS_MULTILINE = 0x00002000; private const int GWL_STYLE = -16; [System.Runtime.InteropServices.DllImport("coredll")] private static extern int GetWindowLong(IntPtr hWnd, int nIndex); [System.Runtime.InteropServices.DllImport("coredll")] private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); public static void MakeButtonMultiline(Button b) { IntPtr hwnd = b.Handle; int currentStyle = GetWindowLong(hwnd, GWL_STYLE); int newStyle = SetWindowLong(hwnd, GWL_STYLE, currentStyle | BS_MULTILINE); }
codice:MakeButtonMultiline(button1);.
Ciao