| {\rtf1\ansi\ansicpg1252\deff0\deflang1044{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}} \viewkind4\uc1\pard\f0\fs17 Enter this into the General Declarations of a form: \par \par Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long \par Private Const CB_GETDROPPEDWIDTH = &H15F \par Private Const CB_SETDROPPEDWIDTH = &H160 \par \par \par Add this to the same form or module: \par \par Public Property Let ComboDropDownWidth(m_cboBox As ComboBox, _ \par ByVal NewComboDropDownWidth As Long) \par SendMessage m_cboBox.hwnd, CB_SETDROPPEDWIDTH, _NewComboDropDownWidth, 0 \par End Property \par \par Public Property Get ComboDropDownWidth(m_cboBox As ComboBox) As Long \par ComboDropDownWidth = SendMessage(m_cboBox.hwnd, CB_GETDROPPEDWIDTH, 0, 0) \par End Property \par \par \par To set the width of a combo box's dropdown list use: \par \par ComboDropDownWidth(MyComboBox) = 500 ' Pixels \par } |
Setting the dropdown width of a combo box |
India web developer web development India | India web development company India ecommerce web developer