你在datagrid的itemdatabound事件中添加处理,datagrid记录就会隔行换背景颜色。如以下代码:Sub TestDataGrid_ItemDataBound(ByVal sender As Object, ByVal e As DataGridItemEventArgs) If e.Item.ItemIndex = -1 Then Exit Sub If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then e.Item.Attributes.Add("onmouseover", "this.style.backgroundColor='#A3CDE2'") End If If e.Item.ItemType = ListItemType.Item Then e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='#EFFCFB'") Else e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='White'") End If End Sub
我现在用6.0啊~看来没法实现啊~
对于斑马线的编程问题,可以使用listctrl控件来灵活编程实现。datagrid功能不强,我都是使用这个东东的http://www.codeproject.com/miscctrl/gridctrl.asp
希望你不要动不动就要代码,自己要学会灵活应用。vc的功能很强,高质量的代码许多都是采用VC编写的,我在深圳
--NAME:余 翔
TEL:13510876790
E-mail:[email protected]