Fomat Money in Grid
Private Sub dgvAsset_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles dgvAsset.CellFormatting
End Sub
Fomat Money in Textbox
Textbox1.Text = Format(CDec(ds.Tables("Asset").Rows(0).Item(4)), "#,###.00")
Private Sub dgvAsset_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles dgvAsset.CellFormatting
If dgvAsset.Columns(e.ColumnIndex).Name = "Price"Then e.CellStyle.Format = "#,##0.00"
e.CellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
End If
End Sub
Fomat Money in Textbox
Textbox1.Text = Format(CDec(ds.Tables("Asset").Rows(0).Item(4)), "#,###.00")
ความคิดเห็น