具有 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/ ...
随机推荐
- Spring Relational Database
为了避免持久化的逻辑分散到应用的各个组件中,将数据访问功能放到一个或多个专注于此项任务的组件中,这样的组件通常称为数据访问对象(DAO)或Repository. 为了避免应用与特定的数据访问策略耦合在 ...
- Coach Said No Worry
I have been losing memories those days. I can't get through what I was doing right then. I have prom ...
- pandas的聚合操作: groupyby与agg
pandas提供基于行和列的聚合操作,groupby可理解为是基于行的,agg则是基于列的 从实现上看,groupby返回的是一个DataFrameGroupBy结构,这个结构必须调用聚合函数(如su ...
- [error]OpenCV Error: Assertion failed (ssize.width > 0 && ssize.height > 0) in resize, file modules/imgproc/src/resize.cpp, line 3289
error OpenCV Error: Assertion failed (ssize.width > && ssize.height > ) terminate call ...
- SLES12SP2使用总结
1. 设置hostname hostnamectl set-hostname hostname***
- python三大框架之一(flask介绍)
Flask , Django, Tornado 是python中常用的框架,也是python的三大框架.它们的区别是:Flask: 轻量级框架: Django:重量级框架: Tornado:性能最好 ...
- unet网络讲解,附代码
转: http://www.cnblogs.com/gujianhan/p/6030639.html key1: FCN对图像进行像素级的分类,从而解决了语义级别的图像分割(semantic segm ...
- C语言--第二周作业评分和总结(5班)
作业链接:https://edu.cnblogs.com/campus/hljkj/CS2017-5/homework/1026 一.评分要求 要求1 阅读指定博客+阅读收获+例子.(5分) 要求2 ...
- n!的质因子分解
其中k为任意质因子,因为a的数值不确定,所有k的值可以任意选择. 以下代码用于求出m!: #include<bits/stdc++.h> LL getpow(LL n,LL k) { LL ...
- CentOS7安装PostgreSQL10,pgadmin4
======PostgreSQL10 CentOS7=================FYI:https://tecadmin.net/install-postgresql-server-centos ...