社区
界面
帖子详情
如何设置listctrl的列宽
jaeson83
2010-01-26 02:53:50
listctrl,选择类型small icon,要做到类似windows的平铺效果,如何设置列宽和列间距?
...全文
460
4
打赏
收藏
如何设置listctrl的列宽
listctrl,选择类型small icon,要做到类似windows的平铺效果,如何设置列宽和列间距?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
showxier
2010-01-26
打赏
举报
回复
CListCtrl::SetIconSpacing和CListCtrl::SetWorkAreas你用用看。达不到效果就用CListCtrl::SetIMageList设置成你想要的Item大小,然后重绘icon和text
xsc2001
2010-01-26
打赏
举报
回复
列宽的间距是做不到的,除非你中间隔一列,也就是多加一列,设置一个小的宽度用来当作间距
luojun9803
2010-01-26
打赏
举报
回复
SetColumnWidth(nCol,nWidth)
必须选择report样式
北京的雾霾天
2010-01-26
打赏
举报
回复
small icon做不到。
mfc_ListView/
ListCtrl
实现点击表头排序与固定
列
宽
MFC. 1. 自定义CMyListView,继承自CListView, 实现点击表头进行该
列
排序以及固定某些
列
宽
的功能。使用时直接继承此View即可。 2. 自定义CMy
ListCtrl
, 继承自CMFC
ListCtrl
, 同样实现上述功能,用于
listctrl
控件。使用时,将控件的control变量更改为CMy
ListCtrl
即可。
Vc++ 控件List Control用法总结
1.新建对话框MFC,在对话框上放一个
ListCtrl
ID:IDC_PATH View:Report 2.为
ListCtrl
添加变量 右击->添加变量m_wndPath 3.找到OnInitDialog()函数添加如下代码: // TODO: 在此添加额外的初始化代码 m_wndPath.DeleteAllItems();//清空 m_wndPath.InsertColumn(0,_T(项目));//添加
列
m_wndPath.InsertColumn(1,_T(所在路径)); m_wndPath.SetColumnWidth(0, 150);//
设置
列
宽
m_wndPath.
Visual C++ 编程资源大全(英文控件)
1,01.zip
Toolbar - Custom status messages and tooltips
用户状态信息与工具提示(3KB)
2,02.zip
Remove system menu from floating toolbar
从浮动工具条中去除系统菜单(2KB)
3,03.zip
Remove close button from floating toolbar
从浮动工具条中去掉关闭按钮(2KB)
4,customizable1.zip
Customizable toolbar
可自定义的工具条(25KB)
5,detoolbar.zip
Adding a drop arrow to a toolbar button
带下拉框的工具条(28KB)
6,detoolbare.zip
Using Hot Toolbar Buttons
类似IE4的工具条(30KB)
7,BCGControlBar.zip
Customizable Toolbar and Menus
可自定义的工具条 (2)(318KB)
8,FixMiniFrame.zip
System menu fix for floating toolbar
更改浮动工具条中的系统菜单(24KB)
9,09.zip
DevStudio like Flat Toolbar
平面工具条 (需 IE3+)(5KB)
10,enh_flatbar.zip
Another Flat ToolBar (does not require MSIE)
另外一种平面工具条 (不需 IE)(81KB)
11,VSOMenu.zip
Visual Studio/Office 97 style Flat Toolbar and Dockable Menu bar
类似Visual Studio/Office 97 的平面工具条与可停靠菜单条(2)(200KB)
12,RebarMenu.zip
IE4 Style Menu (Rebar Menu)
类似IE4 的菜单条(72KB)
13,ToolbarHi.zip
Toolbar with 16M colour images
使用16M色图象的工具条(66KB)
14,multi12.zip
Extended Multi Size Multi Color Toolbar!
扩展型多尺寸多色彩工具条(226KB)
15,15.zip
How to display tooltips for a toolbar in a dialog
在对话框如何为工具条显示工具提示(3KB)
16,16.zip
Displaying text on a Toolbar
在对话框如何为工具条显示工具提示(2KB)
17,toolbar_d.zip
Docking Toolbars Side-By-Side
工具条的停靠(29KB)
18,toolbars.zip
Toolbars with Tooltips in a CFormView derived class
在CFormView派生类中使用带工具提示的工具条(29KB)
19,SwitchTB.zip
Switching Toolbars in MDI
MDI中具有开关显示功能的工具条(47KB)
20,Place Controls on ToolBars
在工具条中放置其他控件(10KB)
21,DialogBarEx1.zip
CDialogBarEx : A Dialog bar with initialization
CDialogBarEx :带初始化的对话条(42KB)
1,01.zip
Setting selected text to read-only
设置
选择的文本为只读(2KB)
2,02.zip
Changing word wrap mode
改变换行模式(2KB)
3,03.zip
Changing tab stops
改变tab的行数(2KB)
4,04.zip
Inserting an RTF string using StreamIn
用RTF插入一个RTF字符串(3KB)
5,05.zip
Providing a Format toolbar
提供一个格式的工具框(8KB)
6,06.zip
convert RTF String RTF tags
变换字符串为RTF格式(7KB)
7,07.zip
CRichEditCtrlEx - Advanced Rich Edit Control
CRichEdit的继承类(21KB)
8,08.zip
The Richedit Ctrl used in chatting
在聊天程序中用Richedit(37KB)
9,09.zip
CRichEditCtrlEx : Replacing "RICHEDIT" control with "RichEdit20A"
替代RichEdit的类CRichEditCtrlEx(16KB)
10,10.zip
Controlling the RichTextCtrl Insert State
控制RichTextCtrl中Insert键状态(80KB)
11,11.zip
CAutoRichEditCtrl - automate rich edit formatting and RTF handling.
自动格式化RTF的继承类CAutoRichEditCtrl(62KB)
1,02.zip
Adding a Control to the Property Sheet
在属性页中添加控件(2KB)
2,06.zip
Using Shortcut Keys for Property Pages
在属性页中使用快捷键(2KB)
3,07.zip
Creating a Property Sheet Inside a Form View - Asaf Levy
在Form View中创建属性页(4KB)
4,08.zip
Creating a Property Sheet Inside a Dialog
在对话框中创建属性页(3KB)
12,18.zip
A resizable property sheet within a view
在视中改变property sheet的大小(4KB)
13,19.zip
overriding the default buttons on CPropertySheets
在CPropertySheets中覆盖默认按钮(2KB)
14,20.zip
Display only One Row of Tabs
只显示一行Tab选择(2KB)
15,21.zip
Add a Font Property Page
添加字体属性页(16KB)
16,22.zip
Resizing the Property Sheet
改变属性页的大小(2KB)
17,23.zip
Resizing the Tab Control
改变Tab控制的大小(2KB)
18,24.zip
Moving and Resizing the Property Pages
移动并改变属性页大小(3KB)
20,27.zip
Using ON_UPDATE_COMMAND_UI in Property Pages
在属性页中使用ON_UPDATE_COMMAND_UI(2KB)
22,29.zip
Inserting a CFormView into a CPropertySheet
将CFormView插入到属性页中(2KB)
23,30.zip
Using Upper- and Lowercase shortcut Keys for Property Pages
在属性页中使用大写和小写快捷键(2KB)
25,32.zip
Automaticaly arange visible controls below the tab control
TAB控制中使控件自动可见(2KB)
27,34.zip
Creating a wizard
创建一个向导(4KB)
21,propsheet1.zip
Propertysheets embedded in Dialogs
在对话框中嵌入Propertysheets(20KB)
24,propinprop.zip
Using shortcut keys in property pages containg property pages
在属性页中使用快捷键(74KB)
26,newprop.zip
Adding a Button to CPropertySheet
在属性页中添加按钮(19KB)
28,PropSheet.zip
Property Sheet Wizard
属性页Wizard(96KB)<96KB>
5,wizprop.zip
Wizard Property Sheets and Pages
Wizard方式的属性表与属性页(3KB)
6,creatingl.zip
Creating a full application using the CPropertySheet.
用CPropertySheet创建完整的应用程序(91KB)
7,updcreate.zip
Creating a full application using the CPropertySheet
更新: 用CPropertySheet创建完整的应用程序(12KB)
8,addbitmap.zip
Placing A Bitmap In The PropertySheet Button Area
将一个位图放到PropertySheet的按纽区域(2KB)
9,add3dtext.zip
Placing a 3D Logo Text In the PropertySheet Button Area
附加功能是控制PropertySheet区域特别是按纽部分的颜色(37KB)
10,proppage.zip
Modifying Property Sheet Templates on Win95
在Win95中修改属性页模板(2KB)
11,propview.zip
Using a modeless property sheet as a 'view' in a Frame
使用非模式的property sheet, 就像框架中的视(53KB)
1,VCMenu.zip
Visual Studio/Office 97 style Flat Toolbar and Dockable Menu bar
类似Visual Studio/Office 97的平面工具条与可停靠菜单条(350KB)
2,contentmenu.zip
A Cool Looking Menu For Easier Navigation
一个很COOL的菜单条(39KB)
3,freemenu.zip
Owner Drawn Menu With Free Color & Font
可使用任意字体与颜色的自画式菜单(35KB)
4,04.zip
Owner Drawn Menu with Icons
带图标的自画式菜单(5KB)
5,05.zip
Owner Drawn Menu with Icons (2)
带图标的自画式菜单(2)(8KB)
6,owner_menu4.zip
Owner Drawn Menu with Icons (4) (automatically uses toolbar res)
带图标的自画式菜单(4) (自动使用工具条对应资源)(109KB)
7,bitmapmenu.zip
Yet another owner draw menu
更新"带图标的自画式菜单"(2)(6KB)
8,bcmenu24.zip
Owner Drawn Menu with Icons (3)
带图标的自画式菜单(3) (使用工具条资源)(62KB)
9,09.zip
Inserting submenus in an existing SDI menu
在SDI菜单中插入子菜单(2KB)
10,10.zip
TrackPopupMenu as an Immediate Function
使用 CMenu::TrackPopupMenu 跟踪弹出菜单的菜单项(2KB)
11,Creating Popup Menus with Titles
Creating Popup Menus with Titles
带提示的弹出式菜单(5KB)
12,12.zip
Finding a menu item position from command id
从Command ID中寻找菜单项(3KB)
13,13.zip
The simplest way to put the MRU list in a submenu
将MRU
列
表加入子菜单的简单途径(2KB)
14,14.zip
Using MRU on a submenu
在子菜单中使用MRU(3KB)
15,15.zip
MRU list in a submenu: the MFC bug and how to correct it.
子菜单中的MRU
列
表: 更正MFC bug(3KB)
16,16.zip
Merging Two Menus
合并两个菜单(3KB)
1,03.zip
Serializable C
ListCtrl
with check sum verify(4KB)
连续的
列
表项的校验和
2,11.zip
Getting the number of columns in report view
获得
列
表视图的
列
数(2KB)
3,12.zip
添加一
列
Adding a column(2KB)
4,13.zip
Detecting column index of the item clicked
监测单击项的索引(13KB)
5,14.zip
Prevent C
ListCtrl
column resizing
禁止调整
列
表控制的大小(2KB)
6,16.zip
How to force a minimum column width
限定一个最小
列
宽
(16KB)
7,17.zip
Autosize a column to fit its content
自动调整
列
的大小(3KB)
8,18.zip
Stationary Columns
固定的
列
数(4KB)
9,19.zip
Disable clicking on selected report view columns
禁止鼠标在
列
表视图单击(2KB)
10,21.zip
Dragging columns to rearrange column sequence
重新排
列
次序(6KB)
11,22.zip
Dragging Items to Rearrange Rows
重新排
列
行数(5KB)
12,24.zip
Allowing items to be edited
允许
列
表项编辑(2KB)
13,27.zip
Using a drop down list to change a subitem
用托放改变子项(10KB)
14,GridList.zip
Multiline Editable Subitems
多
列
可编辑的子项(95KB)
15,subitems2.zip
Editing listview subitems using LVM_GETEDITCONTROL
用LVM_GETEDITCONTROL事件来编辑
列
表视图(46KB)
16,32.zip
Drawing horizontal and vertical gridlines
画水平和竖直的网格线(9KB)
17,33.zip
List control with single / double separator lines
带有一个/两个分割线的
列
表控制(10KB)
18,34.zip
Subclassing the List View Control using MFC
用MFC写的
列
表视图子类(3KB)
19,35.zip
Catching header messages in a CListView
捕捉CListView的头消息(2KB)
20,36.zip
How do I use a derived C
ListCtrl
with a CListView?
怎样使用来源于C
ListCtrl
的
列
表视图(2KB)
21,40.zip
Using sub-strings in non report view
获得报表视图的子串(2KB)
22,Treelist.zip
TreeList : Multi column tree control
多
列
的树性
列
表控制(79KB)
23,43.zip
Connect a list container to a tree/list control
连接一个
列
表容器到
列
表控制(4KB)
24,listclass1.zip
Class with full row highlighting
高亮文本的
列
表框(8KB)
25,46.zip
IE4 Extended Styles in a list control
和IE4类似的
列
表控制(4KB)
26,sorted_Class.zip
CSorted
ListCtrl
reusable base class
可以再度使用的排序
列
表基类(61KB)
27,48.zip
Measure Item for dynamic font changing in a list control
动态的改变
列
表控制的字体(2KB)
28,supergrid.zip
SuperGrid - Yet Another listview control(84KB)
用Listview写的网格控制
29,clistie4.zip
Class for using new features in listview control
列
表视图的子类(5KB)
30,51.zip
Plug-in class to support printing from a listview
列
表视图的插件类 (6KB)
31,52.zip
Print the contents of the list control
打印
列
表视图的内容(7KB)
32,property12.zip
Creating an Object Property List using the C
ListCtrl
用C
listCtrl
类创建一个属性
列
表(57KB)
33,56.zip
Retrieving selected items
找回选择的项的内容(2KB)
34,57.zip
Selecting and deselecting a range of rows
选择和反选择一定范围的行(2KB)
35,58.zip
Selection Highlighting of Entire Row
选择高亮整行(12KB)
36,59.zip
Set focus on a cell
设置
一个单元获得焦点(2KB)
37,60.zip
Sorting the list based on text in any column
按
列
表的文本排序(3KB)
38,61.zip
Sorting list on Numeric Column
按
列
表的数值排序(2KB)
39,62.zip
Sort list based on text/numeric/date-time in any column
按
列
表的文本\数值\时间排序(3KB)
40,63.zip
Sort list (numeric/text) using callback
用回调函数按数值/文本排序 (3KB)
41,64.zip
Sort columns by the image index of the column
通过图像索引排序(3KB)
42,66.zip
Sorting the list when user clicks on column header
当用户单击
列
标题时排序(3KB)
43,67.zip
Indicating sort order in header control
指示
列
标题的排序(5KB)
44,68.zip
Simple list Sorting on Integer Colum
按
列
表的数值排序(2KB)
45,69.zip
A Multi Column Sort listview
一个多
列
排序的
列
表视图(37KB)
46,70.zip
Determining row indices in SortItems() Comparison function
用SortItems函数监测行复数(3KB)
47,75.zip
Handling Title Tips With Drag/Drop Headers Using The Visual C++ 6.0 C
ListCtrl
处理标题的提示(3KB)
48,76.zip
Attaching System ImageList to ListControl
附带系统图像的
列
表控制(3KB)
49,77.zip
Initializing the image list
初始化图像
列
表(2KB)
50,78.zip
Setting or removing an image for an item
设置
和删除项中的图像(78KB)
51,79.zip
Setting a non-standard size image
设置
一个非标准的图像(4KB)
52,83.zip
List Control displaying image thumbnails
在
列
表控制中显示小图像(23KB)
DELPHI 表格控件DBGridEh史上最全使用资料(101页)
一、 DBGridEh(增强型表格组件)功能详解.....................................................................4 二、应用实例..........................................................................................................................5 1. 定制标题行......................................................................................................................5 1) 制作复杂标题行.......................................................................................................5 2) 按钮式标题..............................................................................................................5 3) 标题行显示图片.......................................................................................................5 4) 如根据不同状态在数据单元格中显示相应图片...................................................5 5) 自动显示标题行的升降排序标志符(▽降序△升序)并做相应排序...............6 6) 点dbgrideh 标题排序..............................................................................................7 7) 在DBGridEH 中怎样实现多重排序(标题出现0123等排
列
序号)? ................ 11 8) 让dbgrid显示序号................................................................................................ 11 2. 外观布局........................................................................................................................12 1) 根据不同字段值显示相应的小图片.....................................................................12 2) 显示检查框(checkbox)外观.............................................................................12 3) 显示单、多
列
下拉
列
表.........................................................................................12 4) 显示日历下拉
列
表.................................................................................................13 5) 3D或平面外观效果...............................................................................................13 6) 行头和
列
头的启用关闭.........................................................................................13 7) DBGrid如何实现透明效果?.................................................................................13 8) 滚动条的各种应用.................................................................................................16 9) 数据行高................................................................................................................19 10) DBGrid
设置
Rowheight后如何将单元格内容纵向和垂直都居中?..............19 11)
设置
DBGridEH 自适应
列
宽
的最好方法.........................................................20 12) Ehlib 的DBGridEh首
列
加序号........................................................................21 13) 分行分
列
、单元格的颜色
设置
.........................................................................23 14) 点击不同单元格
列
,执行不同的动作.............................................................27 15) 下拉式计算器.....................................................................................................28 16) 鼠标移到某个单元格,指针形状改变.............................................................28 17) 自动填充网格
列
宽
到网格客户区.....................................................................29 18) 从注册表或ini文件中保存或恢复网格和
列
的层次。...................................29 3. 编辑功能........................................................................................................................29 1) 多选........................................................................................................................29 2) 文本多行显示.........................................................................................................30 3) 显示备注字段.........................................................................................................30 4) 如何让dbgrideh1 显示数据时只显示两位小数...................................................30 5) 获得当前DBGridEh表中单元格的序号.............................................................30 6) 怎样在dbgridEh和Edit中显示金额的千分号...................................................30 7) end;请问怎么才能使DBGridEh不滚动就能提交数据?...................................32 8) 我怎么把dbgrid 里的数据一次插入到数据库呢................................................32 9) 在DBGrid中可选中行而又可进入编辑状态......................................................32 10) 修正DBGrideh 丢失焦点时自动关闭输入法的问题......................................35 11) DBGRIDEH选定多行删除怎么实现...............................................................36 12) DBGrid 滚动表格的代码...................................................................................37 4. 统计功能........................................................................................................................37 白波九道整理自用版 第 3 页 1) 页脚合计................................................................................................................37 2) 定制表格底部(footer)区域的汇总统计行.......................................................38 3) TDBSumList说明..................................................................................................38 4) 如何工作以及为什么有时SumList的集合值计算不正确?.............................39 5) dbgrideh
列
求和.....................................................................................................39 5. 数据功能........................................................................................................................40 1) 查找字段点击某
列
值的下拉按纽弹出一个从数据库取值下拉
列
表...............40 2) 使用DBGridEh自动过滤实现方法.....................................................................40 3) 使用DBGridEh自动过滤实现方法2 ..................................................................41 4) DBGridEh 控件中使用过滤功能 (适用ehlib 5.2 ehlib 5.3)................................42 5) 支持模糊查询.........................................................................................................43 6) ehlib4.4.50中支持模糊匹配的修改方法..............................................................44 7) EhLib 5.0 Build 5.0.13的过滤字串都是模糊过滤修改.......................................45 8) 滚动条滚动时选择不变,还有自动过滤功能的实现.........................................45 9) 增量搜索................................................................................................................46 10) ehlib总是按两次ctrl+f才出来查找框,怎么办?.........................................46 11) 如何改良dbgrideh的文字过滤........................................................................46 12) 改进DBGrideh 表头点击自动排序,实现双击状态轮流.................................47 13) 改良Ehlib 的排序功能,加快排序速度.............................................................49 14) 在DbGridEh中显示TreeView效果................................................................50 15) DBGridEh-KeyList、PickList............................................................................51 16) 主从表
设置
........................................................................................................53 17) 在DbGridEh中显示表中表..............................................................................55 6. 输入/输出.......................................................................................................................56 1) 导入导出数据.........................................................................................................56 2) 从多种格式导入/导出数据到TDBGridEh...........................................................57 3) DBGRID 生成EXCEL报表.................................................................................57 4) 使用TPrintDBGridEh 组件.................................................................................61 5) 打印时确定Ehlib定义的报表表头颜色? ............................................................61 6) Ehlib 中的PrintDBGridEh如何印页码,即第几页共几页...................................62 7) 怎么让PrintDBGridEh只打印DbGridEh 中指定的
列
.......................................62 8) 怎样进行横向打印/ 打印预览?........................................................................62 7. 将存在的DBGrid组件转换为DBGridEh组件...........................................................62 三、EhLib安装问题.............................................................................................................64 1. EhLib 安装步骤.............................................................................................................64 2. EhLib 安装问题(dbsumlst.dcu出错) ..........................................................................64 3. 安装提示找不到.BPL文件...........................................................................................65 四、Delphi 下的优秀表格(Grid)显示控件........................................................................65 1. NextGrid .........................................................................................................................65 2. TopGrid 3.01...................................................................................................................65 3. XLGrid............................................................................................................................66 4. DevExpress ExpressQuantumGrid .................................................................................66 5. TMS Grid Pack...............................................................................................................68 6. EhLib ..............................................................................................................................71 白波九道整理自用版 第 4 页 7. ProfGrid..........................................................................................................................71 8. EasyGrid .........................................................................................................................71 五、delphi 中配置文件的使用(*.ini).........................................................................71 六、窗口动画效果Animatewindow应用...........................................................................72 七、Delphi Excel to Sql Server..............................................................................................73 八、Delphi控制Excel的经验如下:..................................................................................76
设置
MFC中的
ListCtrl
控件的
列
宽
固定不可变
设置
MFC中的
ListCtrl
控件的
列
宽
固定不可变 通过重写虚函数OnNotify实现,OnNotify函数是C
ListCtrl
类中的虚函数,通过重载该函数,来修改
ListCtrl
控件的一些属性。 具体方法: 在控件对应的 .cpp文件中: //禁止控件
列
宽
可变 BOOL XXXXXXX::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) { HD_NOTIFY pHDN = (HD_NOTIFY)lParam; switch
界面
15,979
社区成员
115,897
社区内容
发帖
与我相关
我的任务
界面
VC/MFC 界面
复制链接
扫一扫
分享
社区描述
VC/MFC 界面
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章