unit AComboBox; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TAComboBox = class(TCustomComboBox) private { Private declarations } FArabic: Boolean; procedure SetArabic ( b:Boolean); procedure CreateParams(var Params: TCreateParams); override; public constructor Create(AOwner: TComponent); override; published property Arabic:Boolean read FArabic write SetArabic default true; property Style; {Must be published before Items} property Color; property Ctl3D; property DragMode; property DragCursor; property DropDownCount; property Enabled; property Font; property ItemHeight; property Items; property MaxLength; property ParentColor; property ParentCtl3D; property ParentFont; property ParentShowHint; property PopupMenu; property ShowHint; property Sorted; property TabOrder; property TabStop; property Text; property Visible; property OnChange; property OnClick; property OnDblClick; property OnDragDrop; property OnDragOver; property OnDrawItem; property OnDropDown; property OnEndDrag; property OnEnter; property OnExit; property OnKeyDown; property OnKeyPress; property OnKeyUp; property OnMeasureItem; property OnStartDrag; end; procedure Register; implementation procedure Register; begin RegisterComponents('Freeware', [TAComboBox]); end; constructor TAComboBox.Create(AOwner: TComponent); begin inherited Create(AOwner); FArabic:= True; end; procedure TAComboBox.SetArabic ( b:Boolean); begin FArabic:= b; ReCreateWnd; end; procedure TAComboBox.CreateParams(var Params: TCreateParams); begin inherited CreateParams(Params); { call the inherited first } if FArabic then Params.ExStyle := Params.ExStyle or WS_EX_RTLREADING or WS_EX_RIGHT; end; end.
Make your own free website on Tripod.com