好象只有隱藏呢?如何移除呢?
如何完全移除呢?也就是說如何在這個文件裡面dclusr70.bpl也沒有呢?unit ControlSizer;interfaceuses
Windows, Messages, SysUtils, Classes, Controls, Graphics;type
TControlSizer = class(TCustomControl)
private
{ Private declarations }
FPosList: array [1..8] of Integer;
FRectList: array [1..8] of TRect;
FControl: TControl;
FPatternColor: TColor;
procedure SetPatternColor(const Value: TColor);
procedure WMNCHitTest(var Msg: TWMNCHitTest); message WM_NCHITTEST;
procedure WMSize(var Msg:TWMSize); message WM_SIZE;
procedure WMLButtonDown(var Msg: TWMLButtonDown); message WM_LBUTTONDOWN;
procedure WMMove(var Msg: TWMMove); message WM_MOVE;
protected
{ Protected declarations }
procedure CreateParams(var Params: TCreateParams); override;
procedure CreateHandle; override;
procedure Paint; override;
procedure SizerControlExit(Sender: TObject);
public
{ Public declarations }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Attach(AControl: TControl);
published
{ Published declarations }
property Control: TControl read FControl;
property PatternColor: TColor read FPatternColor write SetPatternColor default clBlack;
end;procedure Register;implementationprocedure Register;
begin
RegisterComponents('Samples', [TControlSizer]);
end;{ TControlSizer }procedure TControlSizer.Attach(AControl: TControl);
var
R: TRect;
begin
if AControl <> nil then
begin
FControl := AControl;
R := FControl.BoundsRect;
InflateRect(R, 2, 2);
BoundsRect := R;
Parent := FControl.Parent;
end;
end;constructor TControlSizer.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
Height := 28;
Width := 28;
FPatternColor := clBlack;
FPosList[1] := htTopLeft;
FPosList[2] := htTop;
FPosList[3] := htTopRight;
FPosList[4] := htRight;
FPosList[5] := htBottomRight;
FPosList[6] := htBottom;
FPosList[7] := htBottomLeft;
FPosList[8] := htLeft;
OnExit := SizerControlExit;
end;procedure TControlSizer.CreateHandle;
begin
inherited Createhandle;
end;procedure TControlSizer.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
Params.ExStyle := Params.ExStyle or WS_Ex_Transparent;
end;destructor TControlSizer.Destroy;
begin inherited Destroy;
end;procedure TControlSizer.Paint;
var
I: Integer;
begin
Canvas.Brush.Color := FPatternColor;
for I := 1 to 8 do
begin
with FRectList[I] do
begin
Canvas.Rectangle(Left, Top, Right, Bottom);
end;
end;
end;procedure TControlSizer.SetPatternColor(const Value: TColor);
begin
if FPatternColor <> Value then
begin
FPatternColor := Value;
Repaint;
end;
end;procedure TControlSizer.SizerControlExit(Sender: TObject);
begin
Free;
end;procedure TControlSizer.WMLButtonDown(var Msg: TWMLButtonDown);
const
SC_DragMove: Longint = $F012;
begin
Perform(WM_SYSCOMMAND, SC_DragMove, 0);
end;procedure TControlSizer.WMMove(var Msg: TWMMove);
var
R: TRect;
begin
R := BoundsRect;
InflateRect(R, -2, -2);
end;procedure TControlSizer.WMNCHitTest(var Msg: TWMNCHitTest);
var
Pt: TPoint;
I: Integer;
begin
Pt := Point(Msg.XPos, Msg.YPos);
Pt := ScreenToClient(Pt);
Msg.Result := 0;
for I := 1 to 8 do
begin
if PtInRect(FRectList[I], Pt) then Msg.Result := FPosList[I];
end;
if Msg.Result = 0 then inherited;
end;procedure TControlSizer.WMSize(var Msg: TWMSize);
var
R: TRect;
X, Y: Integer;
begin
R := BoundsRect;
InflateRect( R, -2, -2);
if Odd(Width) then X := 2 else X := 3;
if Odd(Height) then Y := 2 else Y := 3;
FRectList[1] := Rect(0, 0, 5, 5);
FRectList[2] := Rect(Width div 2 - X, 0, Width div 2 + 5 - X, 5);
FRectList[3] := Rect(Width - 5, 0, Width, 5);
FRectList[4] := Rect(Width - 5, Height div 2 - Y, Width, Height div 2 + 5 - Y);
FRectList[5] := Rect(Width - 5, Height - 5, Width, Height);
FRectList[6] := Rect(Width div 2 - X, Height - 5, Width div 2 + 5 - X, Height);
FRectList[7] := Rect(0, Height - 5, 5, Height);
FRectList[8] := Rect(0, Height div 2 - Y, 5, Height div 2 + 5 - Y);
end;end.
如何完全移除呢?也就是說如何在這個文件裡面dclusr70.bpl也沒有呢?unit ControlSizer;interfaceuses
Windows, Messages, SysUtils, Classes, Controls, Graphics;type
TControlSizer = class(TCustomControl)
private
{ Private declarations }
FPosList: array [1..8] of Integer;
FRectList: array [1..8] of TRect;
FControl: TControl;
FPatternColor: TColor;
procedure SetPatternColor(const Value: TColor);
procedure WMNCHitTest(var Msg: TWMNCHitTest); message WM_NCHITTEST;
procedure WMSize(var Msg:TWMSize); message WM_SIZE;
procedure WMLButtonDown(var Msg: TWMLButtonDown); message WM_LBUTTONDOWN;
procedure WMMove(var Msg: TWMMove); message WM_MOVE;
protected
{ Protected declarations }
procedure CreateParams(var Params: TCreateParams); override;
procedure CreateHandle; override;
procedure Paint; override;
procedure SizerControlExit(Sender: TObject);
public
{ Public declarations }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Attach(AControl: TControl);
published
{ Published declarations }
property Control: TControl read FControl;
property PatternColor: TColor read FPatternColor write SetPatternColor default clBlack;
end;procedure Register;implementationprocedure Register;
begin
RegisterComponents('Samples', [TControlSizer]);
end;{ TControlSizer }procedure TControlSizer.Attach(AControl: TControl);
var
R: TRect;
begin
if AControl <> nil then
begin
FControl := AControl;
R := FControl.BoundsRect;
InflateRect(R, 2, 2);
BoundsRect := R;
Parent := FControl.Parent;
end;
end;constructor TControlSizer.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
Height := 28;
Width := 28;
FPatternColor := clBlack;
FPosList[1] := htTopLeft;
FPosList[2] := htTop;
FPosList[3] := htTopRight;
FPosList[4] := htRight;
FPosList[5] := htBottomRight;
FPosList[6] := htBottom;
FPosList[7] := htBottomLeft;
FPosList[8] := htLeft;
OnExit := SizerControlExit;
end;procedure TControlSizer.CreateHandle;
begin
inherited Createhandle;
end;procedure TControlSizer.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
Params.ExStyle := Params.ExStyle or WS_Ex_Transparent;
end;destructor TControlSizer.Destroy;
begin inherited Destroy;
end;procedure TControlSizer.Paint;
var
I: Integer;
begin
Canvas.Brush.Color := FPatternColor;
for I := 1 to 8 do
begin
with FRectList[I] do
begin
Canvas.Rectangle(Left, Top, Right, Bottom);
end;
end;
end;procedure TControlSizer.SetPatternColor(const Value: TColor);
begin
if FPatternColor <> Value then
begin
FPatternColor := Value;
Repaint;
end;
end;procedure TControlSizer.SizerControlExit(Sender: TObject);
begin
Free;
end;procedure TControlSizer.WMLButtonDown(var Msg: TWMLButtonDown);
const
SC_DragMove: Longint = $F012;
begin
Perform(WM_SYSCOMMAND, SC_DragMove, 0);
end;procedure TControlSizer.WMMove(var Msg: TWMMove);
var
R: TRect;
begin
R := BoundsRect;
InflateRect(R, -2, -2);
end;procedure TControlSizer.WMNCHitTest(var Msg: TWMNCHitTest);
var
Pt: TPoint;
I: Integer;
begin
Pt := Point(Msg.XPos, Msg.YPos);
Pt := ScreenToClient(Pt);
Msg.Result := 0;
for I := 1 to 8 do
begin
if PtInRect(FRectList[I], Pt) then Msg.Result := FPosList[I];
end;
if Msg.Result = 0 then inherited;
end;procedure TControlSizer.WMSize(var Msg: TWMSize);
var
R: TRect;
X, Y: Integer;
begin
R := BoundsRect;
InflateRect( R, -2, -2);
if Odd(Width) then X := 2 else X := 3;
if Odd(Height) then Y := 2 else Y := 3;
FRectList[1] := Rect(0, 0, 5, 5);
FRectList[2] := Rect(Width div 2 - X, 0, Width div 2 + 5 - X, 5);
FRectList[3] := Rect(Width - 5, 0, Width, 5);
FRectList[4] := Rect(Width - 5, Height div 2 - Y, Width, Height div 2 + 5 - Y);
FRectList[5] := Rect(Width - 5, Height - 5, Width, Height);
FRectList[6] := Rect(Width div 2 - X, Height - 5, Width div 2 + 5 - X, Height);
FRectList[7] := Rect(0, Height - 5, 5, Height);
FRectList[8] := Rect(0, Height div 2 - Y, 5, Height div 2 + 5 - Y);
end;end.
解决方案 »
- 串口编程问题
- 如何 使 自身程序在 系统的 任务栏 的 工具栏,实现一闪一闪的效果 , 就像QQ 的聊天窗口 有新消息时就会 一闪一闪的效果,急!!!!!!!!!!!!!!
- 在DELPHI中如何开发电子白板程序以及如何使用RTC SDK进行开发
- 急问!!
- 求安装TeeChart6Delphi7的序列号和密码
- IndyHttp如何访问一个不允许匿名访问的网页
- 如何根据字段的名称查到字段的类型?谢谢!
- 超时已过期!
- 请用过FastReport的朋友帮忙!
- 什么叫做句柄?
- 一个窗体中放两个panel,怎么让他们在不同的分辨率下平分窗体,有这样的控件或方法吗?
- 为何在OpenPictureDialog运行时jpeg格式的图片就显示不出来?
点击按钮remove
选择remove from project
选择后ok就行了