Friday, April 11, 2008

Set ComboBox Height

[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); 
 
private const int CB_SETITEMHEIGHT = 0x153; 
 
private bool SetComboBoxHeight(ComboBox cb, int height) 
{ 
    int rtn = SendMessage(cb.Handle, CB_SETITEMHEIGHT, -1, height); 
    cb.Refresh(); 
    return rtn != -1; 
}

No comments:

Post a Comment