TControl.Perform
----------------------------------------------------------------
Responds as if the control received a specified Windows message.
function Perform(Msg: Cardinal; WParam, LParam: Longint): Longint;
Description
Call Perform to bypass the Windows message queue and send a message directly to the control抯 window procedure.
Perform fills a message record (of type TMessage) with the message ID passed in the Msg parameter, the message parameters passed in WParam and LParam, and a result field of zero. Perform then passes the message record to the WindowProc method for processing.
----------------------------------------------------------------
eg:
procedrue Tform1.FormShow(Sender : Tobjects)
begin
comboBox1.Perform(CB_SETDROPPEDWIDTH, 100, 0);
end;
CB_GETHORIZONTALEXTENT是取得宽度.
CB_SETHORIZONTALEXTENT是设置宽度.
An application sends the CB_SETHORIZONTALEXTENT message to set the width, in pixels, by which a list box can be scrolled horizontally (the scrollable width). If the width of the list box is smaller than this value, the horizontal scroll bar horizontally scrolls items in the list box. If the width of the list box is equal to or greater than this value, the horizontal scroll bar is hidden or, if the combo box has the CBS_DISABLENOSCROLL style, disabled.
CB_SETHORIZONTALEXTENT
wParam = (WPARAM) cxExtent; // scrollable width of list box, in pixels
lParam = 0; // not used, must be zero
Parameters
cxExtent
Specifies the scrollable width of the list box, in pixels.