And*_*and 14
事实上,这是非常可能的.在您的表单中,定义
private
{ Private declarations }
FBitmap: TBitmap;
FBrush: HBRUSH;
protected
procedure WndProc(var Message: TMessage); override;
Run Code Online (Sandbox Code Playgroud)
并做
procedure TForm1.FormCreate(Sender: TObject);
begin
FBitmap := TBitmap.Create;
FBitmap.LoadFromFile('C:\Users\Andreas Rejbrand\Pictures\AS20Utv.bmp');
FBrush := 0;
FBrush := CreatePatternBrush(FBitmap.Handle);
end;
Run Code Online (Sandbox Code Playgroud)
和
procedure TForm1.WndProc(var Message: TMessage);
begin
inherited;
case Message.Msg of
WM_CTLCOLOREDIT, WM_CTLCOLORSTATIC:
if (Message.LParam = Edit1.Handle) and (FBrush <> 0) then
begin
SetBkMode(Message.WParam, TRANSPARENT);
Message.Result := FBrush;
end;
end;
end;
Run Code Online (Sandbox Code Playgroud)
当然,你可以将它包装成你自己的组件,比方说TEditEx
.如果我有时间,我可能会这样做.(并且,请注意,没有必要从第三方公司购买昂贵的(可能不是那么高质量的)组件包.)
归档时间: |
|
查看次数: |
3777 次 |
最近记录: |