20-10-2010, 10:22 AM
السلام عليكم
من الممكن ان تستخدم هذه الطريقة وترث هذا الصنف
من الممكن ان تستخدم هذه الطريقة وترث هذا الصنف
كود :
unit Component1;
interface
uses
SysUtils, Classes, Controls,forms,windows;
type
TComponent1 = class(TComponent)
procedure MyProcedure();
private
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Samples', [TComponent1]);
end;
Procedure SetWinControlBiDi(Control: TWinControl);
var
ExStyle: Longint;
begin
ExStyle := GetWindowLong(Control.Handle, GWL_EXSTYLE);
SetWindowLong(Control.Handle, GWL_EXSTYLE, ExStyle or WS_EX_RTLREADING or WS_EX_RIGHT
or WS_EX_LAYOUTRTL or WS_EX_NOINHERITLAYOUT );
end;
procedure TComponent1.MyProcedure;
var
myfrm:Tform;
myint:integer;
begin
myfrm:=(self.Parent as Tform);
myfrm.Caption:='fghfgh';
for I := 0 to self.ComponentCount- 1 do
if ((self.Components[I] is TTreeView) or (self.Components[I] is TPageControl)) then
SetWinControlBiDi(Components[I] as TWinControl)
end;
end.
بين الانسان والكفر ترك الصلاة فمن تركها فقد كفر .

