Re: Combobox avec liste déroulante alignée sur la droite
BigGrizzly a écrit :
>
> (TVirtualDataset bon sang...)
>
>
Me suis un peu fait chier mais bon...
unit ComboBox1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls;
type
TCombobox1 = class(TCombobox)
private
FMyListHandle : hWnd;
procedure WndProc(var Message: TMessage); override;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('FOST©', [TComboBox1]);
end;
procedure TCombobox1.WndProc(var Message: TMessage);
var R: TRect;
begin
inherited;
if (Message.Msg = WM_CTLCOLORLISTBOX)
then begin
FMyListHandle := Message.LParam;
GetWindowRect(FMyListHandle, R);
if r.Right > Screen.width then
SetWindowPos(FMyListHandle, 0, r.left - (r.right - screen.width), r.Top, 0, 0, swp_nozorder or swp_nosize);
end
end;
end.
|