如果在DataGridView显示有格式的时间,谢谢
数据集中为整数,怎样在表格显示为带格式的字符串。如数据集中数据是 80,表格则显示为 "1 '20 "(也就是1分20秒),谢谢各位
[解决办法]
Dim str As Date = "0分0秒 "
Me.TextBox1.Text = str.AddSeconds(80).ToString( "HH:mm:ss ")
--------------------------------
80为你数据集的整数
[解决办法]
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
For i As Integer = 0 To Me.DataGridView1.Rows.Count - 1
Dim d As Date = "00:00:00 "
Dim dispd As Date = d.AddSeconds(DataGridView1.Rows(i).Cells(3).Value)
Me.DataGridView1.Rows(i).Cells(3).Value = dispd.Minute & " ' " & dispd.Second
Next
End Sub
End Class