- PR -

データグリッドの特定の行の色を変える

1
投稿者投稿内容
タイガーマスク
会議室デビュー日: 2003/02/07
投稿数: 6
投稿日時: 2003-06-23 17:52
VB.NETで開発をしております。
データグリッドで特定の行の色を変えたいのですが、
変わりません。。

---以下ソース---
Private Function RowColorChange(ByVal dtgData As DataGrid) As Boolean

Dim iRowCnt As Integer 'ループカウンタ

Try

For iRowCnt = 0 To dtgData.VisibleRowCount - 1
dtgData.Select(iRowCnt)
If CStr(dtgData.Item(iRowCnt, 0)) = "0" Then
dtgData.SelectionBackColor = Color.Black
ElseIf CStr(dtgData.Item(iRowCnt, 0)) = "2" Then
dtgData.SelectionBackColor = Color.Red
Else
dtgData.SelectionBackColor = Color.Yellow
End If
dtgData.UnSelect(iRowCnt)
Next
Catch
MsgBox("データグリッドの色の変更に失敗しました",MsgBoxStyle.OKOnly, "エラー")
Return False
Exit Function
End Try
Return True

End Function

----------------

Color.IsSystemColor プロパティがFalseになってしまい、
エラーにはならないのですが、色が変化してません。。


すいませんが、よろしくお願いします。
1

スキルアップ/キャリアアップ(JOB@IT)