public class FormMain : System.Windows.Forms.Form
{
public const int GWL_STYLE = (-16); // HOPE THIS IS OK VALUE ! GOT IT OFF THE NET !
public const int BS_MULTILINE = 0x4000; // HOPE THIS IS OK VALUE ! GOT IT OFF THE NET !
[DllImport("coredll.dll")]
private static extern int GetWindowLong(IntPtr hWnd, int nItem);
[DllImport("coredll.dll")]
private static extern void SetWindowLong(IntPtr hWnd, int nItem, int nValue);
...
public FormMain()
{
int style = GetWindowLong(this.button1.Handle, GWL_STYLE);
SetWindowLong(this.button1.Handle, GWL_STYLE, style | BS_MULTILINE);
...
}
private void FormMain_Paint(object sender, PaintEventArgs e)
{
string tmpStr1 = "new";
string tmpStr2 = "line"
button1.Text = tmpStr1 + "\r" + tmpStr2; // tried \n also, will try \r\n too...
...
}
All I get showing in the button is new□line (text is still in one line, but there's that rectangle like character between the two strings)...
Plz help. TIA

Multiline button text won't work in CF2.0?!?
Prakhar
Thanks guys, but... Nevermind, got it. Just replace public const int BS_MULTILINE = 0x4000 with 0x2000 and it works... The a**hole that placed the wrong value on the internet just cost me two hours of not sleeping >I #R%@#$%$%^&$%&*^%$&!!! Though fault's mine too for not double checking, lesson don't pull the very first search engine result you find without checking it first!
What do you use to find WIN32 API const values ! ! That would be a helpfull thing to know in the future...