Edit,Memo,Treeview加背景图片
来源:互联网 发布:mac版的eos utility 编辑:程序博客网 时间:2024/06/15 12:09
//本方法不够完善,比如滚动条还不能加载图片
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
Image1: TImage;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure HandleCTLColorEdit(var Msg: TWMCTLCOLOREDIT);
message WM_CTLCOLOREDIT;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Memo1.Brush.Bitmap := Image1.Picture.Bitmap; // 这里背景图片取image1里的图片
Memo1.Repaint;
end;
procedure TForm1.HandleCTLColorEdit(var Msg: TWMCTLCOLOREDIT);
begin
inherited;
if Msg.ChildWnd = Memo1.Handle then
begin
SetBkMode(Msg.ChildDC, TRANSPARENT);
Msg.Result := Memo1.Brush.Handle;
end;
end;
end.
// DFM
object Form1: TForm1
Left = 215
Top = 126
Width = 390
Height = 287
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
DesignSize = (
382
260)
PixelsPerInch = 96
TextHeight = 13
object Image1: TImage
Left = 216
Top = 64
Width = 105
Height = 105
Picture.Data = {
07544269746D6170AE000000424DAE0000000000000036000000280000000100
00001E000000010018000000000078000000C40E0000C40E0000000000000000
00004FA2C500F2FCFF00C2F4FF00C3F4FF00C5F5FF00C7F5FF00C9F6FF00CBF6
FF00CCF6FF00CEF7FF00D0F7FF00D1F8FF00D3F8FF00D5F8FF00D6F9FF00D8F9
FF00DAFAFF00DBFAFF00DDFAFF00DEFBFF00DFFBFF00E1FBFF00E2FCFF00E3FC
FF00E4FCFF00E5FCFF00E6FDFF00E7FDFF00FAFFFF004FA2C500}
end
object Memo1: TMemo
Left = 32
Top = 24
Width = 313
Height = 193
Anchors = [akLeft, akTop, akRight, akBottom]
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -24
Font.Name = 'MS Sans Serif'
Font.Style = []
Lines.Strings = (
'Memo1')
ParentFont = False
ScrollBars = ssBoth
TabOrder = 0
OnChange = Memo1Change
end
end
- Edit,Memo,Treeview加背景图片
- treeview添加背景图片
- C++Builder之Edit和Memo
- C++Builder之Edit和Memo
- mdi窗口加背景图片
- 为grub2加背景图片
- 为对话框加背景图片
- 为grub2加背景图片
- 背景图片加链接
- Qt控件加背景图片
- CSS背景图片加超链接
- JDesktopPane加背景图片
- 仿唯品会 点击加背景图片
- 给超链接加背景图片
- extjs4.2加背景图片
- TreeView加javascript
- 清空Form上的Edit、Memo、Combobox的Text
- Delphi中组件Label、Edit、Tag、Memo、RichEdit
- 语言
- 生成一个XML文件:XML的序列化器
- (C语言)分支界限法求解旅行商(TSP)问题
- jQuery基础
- 各大网站前端web服务器汇总-nginx居首
- Edit,Memo,Treeview加背景图片
- 在windows下使用git
- android home键监听
- 解析一个XML文件: XML解析器
- 金山题
- SQL Server 2012 'sa'登录错误 18456
- 2014UC的最后一道题题目:第一个只出现一次的字符[算法]
- Ubuntu傻瓜教程之挂卸载U盘
- SQLite数据库的创建