在窗口上加一个Picture,visible--false Public Sub SetBackColor(lvList As ListView, picBoard As PictureBox, Optional FirstColor As ColorConstants = &HE2F1E3, Optional SecondColor As ColorConstants = vbWhite) '只有详细资料格式的情况下才有这种显示出的需要 If lvList.View = lvwReport Then Dim iHeight As Single Dim i As Long iHeight = 0 lvList.Visible = False i = lvList.ListItems.Count + 1 lvList.ListItems.Add i, "Test" iHeight = lvList.ListItems(i).Height lvList.ListItems.Remove i lvList.Visible = True iHeight = iHeight + Screen.TwipsPerPixelY * 2 With picBoard .Cls .AutoRedraw = True .BackColor = lvList.BackColor .ScaleMode = vbTwips .Visible = False .Font = lvList.Font .Width = lvList.Width .Height = iHeight * 2 End With picBoard.Line (0, 0)-(picBoard.Width, picBoard.Height / 2), &HE2F1E3, BF picBoard.Line (0, picBoard.Height / 2)-(picBoard.Width, picBoard.Height), vbWhite, BF lvList.PictureAlignment = lvwTile lvList.Picture = picBoard.Image End If End Sub
在窗口上加一个Picture,visible--false Public Sub SetBackColor(lvList As ListView, picBoard As PictureBox, Optional FirstColor As ColorConstants = &HE2F1E3, Optional SecondColor As ColorConstants = vbWhite) '只有详细资料格式的情况下才有这种显示出的需要 If lvList.View = lvwReport Then Dim iHeight As Single Dim i As Long iHeight = 0 lvList.Visible = False i = lvList.ListItems.Count + 1 lvList.ListItems.Add i, "Test" iHeight = lvList.ListItems(i).Height lvList.ListItems.Remove i lvList.Visible = True iHeight = iHeight + Screen.TwipsPerPixelY * 2 With picBoard .Cls .AutoRedraw = True .BackColor = lvList.BackColor .ScaleMode = vbTwips .Visible = False .Font = lvList.Font .Width = lvList.Width .Height = iHeight * 2 End With picBoard.Line (0, 0)-(picBoard.Width, picBoard.Height / 2), &HE2F1E3, BF picBoard.Line (0, picBoard.Height / 2)-(picBoard.Width, picBoard.Height), vbWhite, BF lvList.PictureAlignment = lvwTile lvList.Picture = picBoard.Image End If End Sub
第一個問題: yyyy-MM-dd hh:mm:ss
第一个问题:自定义格式 Format (DTPicker1.value,"yyyy-mm-dd hh:mm:ss")
Fromat:2-dtpTime2、最好给ListView加背景。
MM大写
2.最好用VsFlexGrid网格控件,留个Email:Cyj888888◎SINA.COM,我有这个控件。
第二个问题:再试试就加上了。
^_^
Public Sub SetBackColor(lvList As ListView, picBoard As PictureBox, Optional FirstColor As ColorConstants = &HE2F1E3, Optional SecondColor As ColorConstants = vbWhite)
'只有详细资料格式的情况下才有这种显示出的需要
If lvList.View = lvwReport Then
Dim iHeight As Single
Dim i As Long
iHeight = 0
lvList.Visible = False
i = lvList.ListItems.Count + 1
lvList.ListItems.Add i, "Test"
iHeight = lvList.ListItems(i).Height
lvList.ListItems.Remove i
lvList.Visible = True
iHeight = iHeight + Screen.TwipsPerPixelY * 2
With picBoard
.Cls
.AutoRedraw = True
.BackColor = lvList.BackColor
.ScaleMode = vbTwips
.Visible = False
.Font = lvList.Font
.Width = lvList.Width
.Height = iHeight * 2
End With
picBoard.Line (0, 0)-(picBoard.Width, picBoard.Height / 2), &HE2F1E3, BF
picBoard.Line (0, picBoard.Height / 2)-(picBoard.Width, picBoard.Height), vbWhite, BF
lvList.PictureAlignment = lvwTile
lvList.Picture = picBoard.Image
End If
End Sub
Public Sub SetBackColor(lvList As ListView, picBoard As PictureBox, Optional FirstColor As ColorConstants = &HE2F1E3, Optional SecondColor As ColorConstants = vbWhite)
'只有详细资料格式的情况下才有这种显示出的需要
If lvList.View = lvwReport Then
Dim iHeight As Single
Dim i As Long
iHeight = 0
lvList.Visible = False
i = lvList.ListItems.Count + 1
lvList.ListItems.Add i, "Test"
iHeight = lvList.ListItems(i).Height
lvList.ListItems.Remove i
lvList.Visible = True
iHeight = iHeight + Screen.TwipsPerPixelY * 2
With picBoard
.Cls
.AutoRedraw = True
.BackColor = lvList.BackColor
.ScaleMode = vbTwips
.Visible = False
.Font = lvList.Font
.Width = lvList.Width
.Height = iHeight * 2
End With
picBoard.Line (0, 0)-(picBoard.Width, picBoard.Height / 2), &HE2F1E3, BF
picBoard.Line (0, picBoard.Height / 2)-(picBoard.Width, picBoard.Height), vbWhite, BF
lvList.PictureAlignment = lvwTile
lvList.Picture = picBoard.Image
End If
End Sub
Format (DTPicker1.value,"yyyy-mm-dd hh:mm:ss")