標籤

2011年1月22日 星期六

DataGridView 使用DataGridViewComboBoxCell方法

Private Sub dgvPROD_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvPROD.CellEndEdit
Select Case dgvPROD.CurrentCell.OwningColumn.Name
Case "upNAME"
dgvPROD.Item("sbPPNO", e.RowIndex).Value = dgvPROD.Item("upNAME", e.RowIndex).Value
dgvPROD.Item("ppNAME", e.RowIndex).Value = dgvPROD.Item("upNAME", e.RowIndex).FormattedValue
End Select
End Sub

Private Sub dgvPROD_EditingControlShowing1(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles dgvPROD.EditingControlShowing
If dgvPROD.CurrentCell.OwningColumn.Name = "upNAME" Then
With CType(dgvPROD.CurrentCell, DataGridViewComboBoxCell)
.DataSource = ArrayComBox.ComBox2Item("Select ppNAME,ppNUMB From ProdPlace Where ppANSW='" &
dgvPROD.CurrentRow.Cells("sbPDNO").Value.ToString & "' Order by ppSORT")
.DisplayMember = "DisplayValue"
.ValueMember = "ValueData"
.InheritedStyle.BackColor = Color.Transparent
End With
End If
End Sub

優點:可動態隨row而異動cellvALUE
缺點:電腦太低階,會反應慢

使用 DiskSpd 測試磁碟效能

  DiskSpd 是微軟創建的命令行磁碟測試工具。它結合了強大的IO工作負載定義來測量磁碟效能。由於它支援自由配置和調整參數,使其成為存儲效能測試、驗證和基準測試的理想工具。 步驟 1. 從 GitHub (說明) https://github.com/Microsoft/di...