【发布时间】:2015-09-16 18:11:24
【问题描述】:
我使用 Delphi XE,我想让一个标准的 ListView 表现得像我想要的那样。 我希望列表视图是 vsReport,这样我就可以为我的项目设置组。 在设计时,我创建了列(一个名为 Topic 的列)、两个组以及每个组的一些项目。
在设计时 ListView 看起来很棒,但在运行时,我的第一组不知何故部分隐藏在列标题下。以下是图片:
在设计时:
运行时:
这是我的 DFM
object Form2: TForm2
Left = 326
Top = 150
Caption = 'Form2'
ClientHeight = 636
ClientWidth = 1289
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object ListView1: TListView
Left = 0
Top = 0
Width = 205
Height = 636
Align = alLeft
Columns = <
item
Caption = 'Topic'
Width = 200
end>
ColumnClick = False
DoubleBuffered = True
FullDrag = True
Groups = <
item
Header = 'First group'
GroupID = 0
State = []
HeaderAlign = taLeftJustify
FooterAlign = taLeftJustify
Subtitle = 'Options bellow'
TitleImage = 1
end
item
Header = 'Settings'
GroupID = 1
State = [lgsNormal]
HeaderAlign = taLeftJustify
FooterAlign = taLeftJustify
Subtitle = 'Other options here'
TitleImage = 0
end>
HideSelection = False
HotTrack = True
HotTrackStyles = [htUnderlineCold, htUnderlineHot]
Items.ItemData = {
059E000000030000000000000000000000FFFFFFFF0000000000000000000000
000A4600690072007300740020006900740065006D000100000001000000FFFF
FFFF0000000000000000000000000B5300650063006F006E0064002000690074
0065006D000200000002000000FFFFFFFF000000000100000000000000134600
69007300720074002000730065007400740069006E0067007300200069007400
65006D00}
GroupView = True
RowSelect = True
ParentDoubleBuffered = False
ShowWorkAreas = True
TabOrder = 0
ViewStyle = vsReport
OnClick = ListView1Click
ExplicitTop = 8
ExplicitHeight = 497
end
end
如何防止这种情况发生?
【问题讨论】: