具有 Button 风格的 Panel

unit Unit2; interface uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ImgList, ExtCtrls; type
TForm2 = class(TForm)
ImageList1: TImageList;
Panel1: TPanel;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end; TVSPanel = class(TCustomPanel)
private
protected
procedure Paint; override;
public end; var
Form2: TForm2; implementation uses Themes; {$R *.dfm} { TVSPanel } procedure TVSPanel.Paint;
var
Details: TThemedElementDetails;
begin
inherited;
if ThemeServices.ThemesEnabled then
begin
Details := ThemeServices.GetElementDetails(tttBaloonNormal{tbPushButtonHot}); {这里画个按钮处于 Hot 状态下的样子}
PerformEraseBackground(Self, Canvas.Handle); {擦除画按钮时的背景}
ThemeServices.DrawElement(Canvas.Handle, Details, ClientRect);
ThemeServices.DrawText(Canvas.Handle, Details, Caption, ClientRect,
DT_EXPANDTABS or DT_VCENTER or DT_CENTER or DT_SINGLELINE, );
end;
end; procedure TForm2.FormCreate(Sender: TObject);
var
APanel: TVSPanel;
begin
APanel := TVSPanel.Create(Application);
APanel.Left := ;
APanel.Top := ;
APanel.Width := ;
APanel.Height := ;
APanel.Caption := '具有 Button 风格的 Panel';
APanel.Parent := Self;
end; end.
具有 Button 风格的 Panel的更多相关文章
- 具有 Button 风格的 Panel(覆盖TCustomPanel的Paint函数,用到了ThemeServices)
unit Unit2; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms ...
- PerformEraseBackground 擦除背景(ThemeServices)
PerformEraseBackground 擦除背景的简单方法(外带ThemeServices例子) 在查这个函数的时候,顺便看到了有趣的代码. 怎么使用 Themes . unit Unit2; ...
- Delphi 完全时尚手册之 Visual Style 篇 (界面不错) 转自http://blog.csdn.net/iseekcode/article/details/4733229
这里先说说两个概念:Theme(主题)和 Visual Style .Theme 最早出现在 Microsoft Plus! for Windows 95 中,是 Windows 中 Wallpape ...
- Delphi 完全时尚手册之 Visual Style 篇
这里先说说两个概念:Theme(主题)和 Visual Style .Theme 最早出现在 Microsoft Plus! for Windows 95 中,是 Windows 中 Wallpape ...
- 触发按钮改变panel面板上的小圆圈颜色
import javax.swing.*; import java.awt.event.*; import java.awt.*; public class TouChaCol implements ...
- 2.4 easyui - panel的使用
<div id="p" class="easyui-panel" title="My Panel" style ...
- Android-Dialog风格Activity开发
1.设置窗口风格 : ①在Manifest中设置主题属性android:theme="@android:style/Theme.Dialog",或者 Theme.Holo.Dial ...
- 【Winfrom-Panel】Panel隐藏与显示,自动隐藏菜单, Auto-Hide Menu
设计界面:2个button,一个panel 当鼠标移动到btnHome时,显示menuPanel 当鼠标离开btnHome时,隐藏menuPanel 当btnPin箭头向左时,menuPanel为自动 ...
- jquery 停止动画 stop的几种用法
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
随机推荐
- SpringBatch Sample (一)(Hello World)
通过前面两篇关于Spring Batch文章的介绍,大家应该已经对Spring Batch有个初步的概念了.这篇文章,将通过一个”Hello World!”实例,和大家一起探讨关于Spring Bat ...
- Java包、类、数据类型、表达式和标识符
1.基本数据类型 类型名称 类型长度 取值范围 byte 8位(1字节) -128~127 short 16位(2字节) -32768~32767 int 32位(4字节) -2147483648~2 ...
- msp430板子接485接口的气体传感器问题及处理
现象:板子的485有问题(能收但是不能发) 485的方向位没有设置因此485芯片一直处于接收的状态,而发送不了处理方法:在需要发送时,把485方向位置于发送,发送完后再把方向位置回接收.但注意,要在发 ...
- sudo with no password
/********************************************************************************* * sudo with no pa ...
- re.compile
详情见 >>> import re >>> s = "adfad asdfasdf asdfas asdfawef asd adsfas " & ...
- QT学习相关
1. vs2012的编译器对execution_character_set("utf-8")无反应的bug在vs2013中解决 2. 安装上vs2013后,重装的qt插件,发现不能 ...
- MAC使用mysql报错:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
遇到这种错误,需要重置密码. Step1:停止mysql,命令如下: $ sudo service mysql stop 或者是 $ sudo /usr/local/mysql/support-fil ...
- 20155219 2016-2017-2 《Java程序设计》第2周学习总结
20155219 2016-2017-2 <Java程序设计>第2周学习总结 教材学习内容总结 类型:整数,字节(需要逐字节处理数据时,如图像处理,编码处理等,会使用byte类型),浮点数 ...
- java-代码块-局部代码块、构造代码块、静态代码块
1.代码块概述: 在Java中,使用{ }括起来的代码被称为代码块. 2.代码块分类: 根据其位置和声明的不同,可以分为局部代码块,构造代码块.静态代码块和同步代码块(多线程). 3.常见代码块的应用 ...
- 【BZOJ2019】nim
直播写题这刺激233 原题: 著名游戏设计师vfleaking,最近迷上了Nim.普通的Nim游戏为:两个人进行游戏,N堆石子,每回合可以取其中某一堆的任意多个,可以取完,但不可以不取.谁不能取谁输. ...