如何写类 type MyClass=class(MyParentClass) private ... public ...end; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 TWDMemo = class(TCustomControl) private FScrollBars: TScrollStyle; FBorderStyle: TBorderStyle; protected procedure CreateParams(var Params: TCreateParams); override; procedure Paint; override; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; end;implementationconstructor TWDMemo.Create(AOwner: TComponent);begin inherited Create(AOwner); Height := 200; Width := 320; ParentFont := False; Font.Name := 'Fixedsys'; Font.Charset := GB2312_CHARSET; Font.Size := 12; Font.Style := []; Canvas.Font.Assign(Font); FScrollBars := ssBoth; FBorderStyle := bsSingle;end;destructor TWDMemo.Destroy;begin inherited Destroy;end;procedure TWDMemo.CreateParams(var Params: TCreateParams);const ScrollBar: array[TScrollStyle] of DWORD = (0, WS_HSCROLL, WS_VSCROLL, WS_HSCROLL or WS_VSCROLL); BorderStyles: array[TBorderStyle] of DWORD = (0, WS_BORDER);begin inherited CreateParams(Params); with Params do begin Style := Style or ScrollBar[FScrollBars] or BorderStyles[FBorderStyle] or WS_CLIPCHILDREN; if NewStyleControls and Ctl3D and (FBorderStyle = bsSingle) then begin Style := Style and not WS_BORDER; ExStyle := ExStyle or WS_EX_CLIENTEDGE; end; end;end;procedure TWDMemo.Paint;begin Canvas.FillRect(ClientRect);end; 呵呵,delphi不是有那么多unit吗?去打开看看就知,从Tobject到 求:数据库SQL SERVER保存读取图片例程。(jpg和bmp格式) 关于C\S分布式数据库日志问题! 哪个函数可以把文件指针移到文件首 怎样使光标在DBGridEH里垂直移动? 做过POS打印程序的高手快进来,求救,急,在线等 请教一个关于多线程的问题??(请各位多多指教啊!!) 无法解决 equal to 操作的排序规则冲突 delphi&stringgrid控件的小问题! 小杨来收分吧!帮我解决这个问题! Delphi imge控件如何加载缩放的png图片 电子商务问题的解决! Delphi中类的属性可否是自定义类型?(续)
private
FScrollBars: TScrollStyle;
FBorderStyle: TBorderStyle;
protected
procedure CreateParams(var Params: TCreateParams); override;
procedure Paint; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
end;implementationconstructor TWDMemo.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
Height := 200;
Width := 320;
ParentFont := False;
Font.Name := 'Fixedsys';
Font.Charset := GB2312_CHARSET;
Font.Size := 12;
Font.Style := [];
Canvas.Font.Assign(Font);
FScrollBars := ssBoth;
FBorderStyle := bsSingle;
end;destructor TWDMemo.Destroy;
begin
inherited Destroy;
end;procedure TWDMemo.CreateParams(var Params: TCreateParams);
const
ScrollBar: array[TScrollStyle] of DWORD = (0, WS_HSCROLL, WS_VSCROLL,
WS_HSCROLL or WS_VSCROLL);
BorderStyles: array[TBorderStyle] of DWORD = (0, WS_BORDER);
begin
inherited CreateParams(Params);
with Params do begin
Style := Style or ScrollBar[FScrollBars] or BorderStyles[FBorderStyle]
or WS_CLIPCHILDREN;
if NewStyleControls and Ctl3D and (FBorderStyle = bsSingle) then begin
Style := Style and not WS_BORDER;
ExStyle := ExStyle or WS_EX_CLIENTEDGE;
end;
end;
end;procedure TWDMemo.Paint;
begin
Canvas.FillRect(ClientRect);
end;