如何修改LISTVIEW控件所显示的每行数据的高度,也就是
Dim itmx As ListItem Set itmx = lsv.ListItems.Add(, , " " & mrc(1))
itmx.Height = itmx.Height + 10 该条语句能否实现,我试过了但是没有效果!!!
Dim itmx As ListItem Set itmx = lsv.ListItems.Add(, , " " & mrc(1))
itmx.Height = itmx.Height + 10 该条语句能否实现,我试过了但是没有效果!!!
实现字体变化,你在设
ListView1->Canvas->Font->Size = 12;
ListView1->Canvas->Font->Name = "宋体";
随你的便了!
Const WM_USER = &H400
Const LB_GETITEMHEIGHT = (WM_USER + 34)
Const LB_SETITEMHEIGHT = &H1A0
Const WM_SETREDRAW = &HB'Height is returned in terms of pixels
Function ListBox_getItemHeight(st As Control) As Integer
'Retrieve the height of the listbox
'item
ListBox_getItemHeight = SendMessage((st.hwnd), LB_GETITEMHEIGHT, 0, &O0)
End Function
'Sets the height of the items of the
'listbox to a specified one.
Sub ListBox_setRowHeight(st As Control, Height As Long)
Dim ignore As Integer
ignore = SendMessage((st.hwnd), LB_SETITEMHEIGHT, 0, _
ByVal Height)
'Refresh the listbox
ignore = SendMessage((st.hwnd), WM_SETREDRAW, True, 0&)
End SubPrivate Sub Command1_Click()
Dim i As Long
i = ListBox_getItemHeight(list1)
i = i + 4
ListBox_setRowHeight list1, i
End Sub
Private Sub Form_Load()
Dim i
For i = 1 To 5
list1.AddItem "演示" + Format(i)
Next
End Sub