delphi ListView 设置固定列宽
object Form1: TForm1
Left =
Top =
Caption = 'Form1'
ClientHeight =
ClientWidth =
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
OnDestroy = FormDestroy
PixelsPerInch =
TextHeight =
object lvErrMsgs: TListView
Left =
Top =
Width =
Height =
Align = alTop
BevelInner = bvNone
BevelOuter = bvNone
BorderWidth =
Columns = <
item
Caption = ' '
Width =
end
item
Caption = ####
Width =
end
item
Caption = ####
Width =
end
item
Caption = ####
Width =
end>
ColumnClick = False
DragCursor = crAppStart
FlatScrollBars = True
GridLines = True
HideSelection = False
Items.ItemData = {
05450000000100000000000000FFFFFFFFFFFFFFFF03000000FFFFFFFF000000
000003310031003100F85CC32603320032003200A85BC326057A007800630076
006200B059C326FFFFFFFFFFFF}
ReadOnly = True
RowSelect = True
ShowWorkAreas = True
TabOrder =
ViewStyle = vsReport
ExplicitTop = -
ExplicitWidth =
end
end
unit Unit1; interface uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls; type
TForm1 = class(TForm)
lvErrMsgs: TListView;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
FListViewOldWndProc: TWndMethod;
procedure ListViewNewWndProc(var Msg: TMessage);
{ Private declarations }
public
{ Public declarations }
end; var
Form1: TForm1; implementation
uses
CommCtrl; {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject);
begin
FListViewOldWndProc := lvErrMsgs.WindowProc;
lvErrMsgs.WindowProc := ListViewNewWndProc;
end; procedure TForm1.FormDestroy(Sender: TObject);
begin
lvErrMsgs.WindowProc := FlistViewOldWndProc;
FListViewOldWndProc := nil;
end; procedure TForm1.ListViewNewWndProc(var Msg: TMessage);
var
hdn: ^THDNotify;
begin
if Msg.Msg = WM_NOTIFY then
begin
hdn := Pointer(Msg.lParam);
if (hdn.hdr.code = HDN_BeginTrackW) or (hdn.hdr.code = HDN_BeginTrackA) then
Msg.Result :=
else
FListViewOldWndProc(Msg);
end else
FListViewOldWndProc(Msg);
end; end.
delphi ListView 设置固定列宽的更多相关文章
- java表格操作之设置表格列宽
设置所有列的宽度 /** * 设置所有列的列宽 * @param table * @param width */ public void setAllColumnWidth(JTable table, ...
- Dev gridView中设置自适应列宽和日期显示格式、金额的显示格式
在Dev GridView控件中,数据库中表数据日期都是长日期格式(yyyy-MM-dd HH:mm:ss),但显示在控件变成短日期格式(yyyy-MM-dd),金额显示要显示精确的数值, 比如80. ...
- 使用像素单位设置 EXCEL 列宽或行高
在导出 Excel 的时候, 经常要需要给列设置宽度或给行设置高度, 在使用 NPOI 或 EppPlus 等组件进行操作的时候, 列宽和行高的单位都不是像素, 好像是英寸,具体是啥也说不清. 平常在 ...
- Aspose.Cells设置自动列宽(最佳列宽)及一些方法总结
/// <summary> /// 设置表页的列宽度自适应 /// </summary> /// <param name="sheet">wor ...
- 动态设置 GridView 列宽
/// <summary> /// 设置简单评语列的宽度 /// </summary> /// <param name=&quo ...
- CSS表格固定列宽
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 关于bootstrap table 固定列宽
首先为table 设置 style="table-layout: fixed;" <table id="assessStage" data-height= ...
- WPF学习笔记(3):ListView根据内容自动调整列宽
DataGrid中,只要不设置DataGrid的宽度和列宽度,或者将宽度设置为Auto,那么表格就会根据内容自动调整宽度,以显示所有内容.但如果是ListView,按以上方法设置,却达不到列宽自动调整 ...
- Java 设置Excel自适应行高、列宽
在excel中,可通过设置自适应行高或列宽自动排版,是一种比较常用的快速调整表格整体布局的方法.设置自适应时,可考虑2种情况: 1.固定数据,设置行高.列宽自适应数据(常见的设置自适应方法) 2.固定 ...
随机推荐
- Understanding about numerical stability, convergence and consistency
In a computer simulation of the real world, physical quantities, which usually have continuous distr ...
- 【BZOJ】3022: [Balkan2012]The Best Teams
原题链接 题面 (为啥这题没有题面-- 给出\(N\)个人,和年龄\(age_{i},skill_{i}\) 然后给出\(M\)个询问,就是年龄在\(a\)以下选不超过\(k\)个人 要求选择的人水平 ...
- 【Android】Android apk默认安装位置设置
在Android工程中,设置apk的默认安装位置 在AndroidManifest.xml文件Manifest标签中添加android:installLocation属性 android:instal ...
- Django时区的解释
https://segmentfault.com/q/1010000000405911
- CodeSignal 刷题 —— almostIncreasingSequence
Given a sequence of integers as an array, determine whether it is possible to obtain a strictly incr ...
- 关于mybatis缓存配置讲解
一级缓存: 一级缓存是默认的. 测试:在WEB页面同一个查询执行两次从日志里面看同样的sql查询执行两次. 2次sql查询,看似我们使用了同一个sqlSession,但是实际上因为我们的dao继承了S ...
- Java中 输入字符串的时候next()和nextLine()有什么区别
假设有一段文本如下:abc def ghijkl mno pqr stuvw xyz 用next(),第一次取的是abc,第二次取的是def,第三次取的是ghij用nextLine(),第一次取的是a ...
- BroadcastReceiver插件化解决方案
--摘自<android插件化开发指南> 1.静态广播和动态广播仅区别于注册方式的不同.静态广播的注册信息保存在PMS中,动态广播的注册信息保存在AMS中 2.发送广播,也就是Contex ...
- Sublime Text3搭建PHP开发环境
Sublime Text3搭建PHP开发环境 本文主要给大家分享了关于Sublime Text3搭建PHP开发环境 ,感兴趣的小伙伴可以做一下参考 一.Sublime text3安装 到官网http: ...
- POJ1062昂贵的聘礼(经典) 枚举区间 +【Dijkstra】
<题目链接> 昂贵的聘礼 Description 年轻的探险家来到了一个印第安部落里.在那里他和酋长的女儿相爱了,于是便向酋长去求亲.酋长要他用1000 ...