Here ya go! The Width of the dropdown can't be LESS than the width of the Combobox and the combobox STYLE must either be csDROPDOWN or csDROPDOWNLIST (use EE Object inspector)

DEBUG TRACE
SET VAR CB_SETDROPWIDTH INTEGER = 352
SET VAR CB_ERR INTEGER = -1
SET VAR DROPWIDTH INTEGER = 200
SET VAR hCbo INTEGER = 0
SET VAR hCbotx TEXT = NULL

GETPROPERTY CboOne HANDLE 'hcbotx'

SET VAR hCbo INTEGER = (INT(.hCbotx))
{
Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer,
ByVal lParam As Any) As Long
}
IF (chkfunc('SendMessage')) = 0 THEN
 STDCALL function 'SendMessageA' alias 'SendMessage'  +
 (integer, integer, integer, integer) : integer

ENDIF
-- remember the order of args  is reversed from the API declaration
SET VAR vret INTEGER = +
(dlcall('User32', 'SendMessageA', 0 , DROPWIDTH, CB_SETDROPWIDTH, hCbo))

IF vret = .CB_ERR THEN
 PAUSE 2 USING 'SendMessage to ComboBox didn''t work'
ELSE
 SET VAR vmsg = ('Width of ComboBox set to ' + (CTXT(.vret)))
 PAUSE 2 USING .vmsg
ENDIF

RETURN

----- Original Message ----- From: "Lawrence Lustig" <[email protected]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Tuesday, January 20, 2009 10:56 AM
Subject: [RBASE-L] - Using CB_SETDROPPEDWIDTH to set drop down width.


I wonder if anyone (this means you Mike) has worked out the DLCALL code
to use the CB_SETDROPPEDWIDTH  windows message to change the drop down
width of a combo box?

--
Larry




Reply via email to