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的更多相关文章

  1. 具有 Button 风格的 Panel(覆盖TCustomPanel的Paint函数,用到了ThemeServices)

    unit Unit2; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms ...

  2. PerformEraseBackground 擦除背景(ThemeServices)

    PerformEraseBackground 擦除背景的简单方法(外带ThemeServices例子) 在查这个函数的时候,顺便看到了有趣的代码. 怎么使用 Themes . unit Unit2; ...

  3. Delphi 完全时尚手册之 Visual Style 篇 (界面不错) 转自http://blog.csdn.net/iseekcode/article/details/4733229

    这里先说说两个概念:Theme(主题)和 Visual Style .Theme 最早出现在 Microsoft Plus! for Windows 95 中,是 Windows 中 Wallpape ...

  4. Delphi 完全时尚手册之 Visual Style 篇

    这里先说说两个概念:Theme(主题)和 Visual Style .Theme 最早出现在 Microsoft Plus! for Windows 95 中,是 Windows 中 Wallpape ...

  5. 触发按钮改变panel面板上的小圆圈颜色

    import javax.swing.*; import java.awt.event.*; import java.awt.*; public class TouChaCol implements ...

  6. 2.4 easyui - panel的使用

    <div id="p" class="easyui-panel" title="My Panel"             style ...

  7. Android-Dialog风格Activity开发

    1.设置窗口风格 : ①在Manifest中设置主题属性android:theme="@android:style/Theme.Dialog",或者 Theme.Holo.Dial ...

  8. 【Winfrom-Panel】Panel隐藏与显示,自动隐藏菜单, Auto-Hide Menu

    设计界面:2个button,一个panel 当鼠标移动到btnHome时,显示menuPanel 当鼠标离开btnHome时,隐藏menuPanel 当btnPin箭头向左时,menuPanel为自动 ...

  9. jquery 停止动画 stop的几种用法

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

随机推荐

  1. C#类中字段封装为属性

    本文描述内容转载 https://zhidao.baidu.com/question/1174413218458798139.html 感谢 冥冥有你PD 的解答!!! 问题思索1 类成员包括变量和方 ...

  2. GCC栈溢出保护

    逆向过elf程序都知道,GCC的canary,x86_64下从fs:0x28偏移处获取,32位下从gs:0x14偏移处获取.但知道canary如何产生,为什么在这里取的人比较少. 下面以x86_64平 ...

  3. 【c++】函数默认参数

    c++ Prime Plus sixth edition page274 如何设置默认值呢?必须通过函数原型. 只有原型指定了默认值.函数定义与没有默认参数时完全相同. 参考 1. http://ww ...

  4. Ubuntu16.04安装tensorflow+安装opencv+安装openslide+安装搜狗输入法

    Ubuntu16.04在cuda以及cudnn安装好之后,安装tensorflow,tensorflow以及opencv可以到网上下载对应的安装包并且直接在安装包所在的路径下直接通过pip与conda ...

  5. 搜索入门_简单搜索bfs dfs大杂烩

    dfs题大杂烩 棋盘问题  POJ - 1321 和经典的八皇后问题一样.  给你一个棋盘,只有#区域可以放棋子,同时同一行和同一列只能有一个棋子. 问你放k个棋子有多少种方案. 很明显,这是搜索题. ...

  6. Django中的应用

    1.什么是应用 应用就是网站中的一个独立的程序模块,在Django中,主目录一般不处理具体的请求,主目录一般要处理的是项目的初始化操作以及请求的分发(分布式请求处理).而具体的请求是由各个应用去处理. ...

  7. Unity调用Windows弹框、提示框(确认与否,中文)

    Unity调用Windows弹提示框 本文提供全流程,中文翻译. Chinar 坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 -- 高分辨率用户请根据需求调整网页缩放比例) Chinar -- ...

  8. try catch之ajax调错

  9. 2017.8.23 shell判断文件,目录是否存在或者具有权限

    #!/bin/sh myPath="/var/log/httpd/" myFile="/var /log/httpd/access.log" #这里的-x 参数 ...

  10. springboot+kotlin+springcloud+java+grade+maven混编?

    springboot + maven + java vs springboot + gradle + kotlin 快速搭建:https://start.spring.io/ springclould ...