首页 > 慧问 > 频道

如何根据字段列的值来改变LAYOUTVIEW的CAPTION颜色

发表于2019-05-10 回复:0 查看:2115  |  

比如,我希望入院日期为今天的CARD,其CAPTION栏显示为红色来突出显示

就象在GRIDVIEW下可以用下面的语句来控制行的颜色

    Private Sub AdvBandedGridView1_RowStyle(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs) Handles AdvBandedGridView1.RowStyle
        Dim view As DevExpress.XtraGrid.Views.Grid.GridView = sender
        If (e.RowHandle >= 0) Then
            Dim category1 As String = view.GetRowCellDisplayText(e.RowHandle, view.Columns("入院日期"))
            Dim category2 As String = view.GetRowCellDisplayText(e.RowHandle, view.Columns("出院日期"))
            If category1.Contains(Replace(DateTime.Now.ToShortDateString, "/", "")) Then
                e.Appearance.BackColor = Color.Orange
            End If
            If category2.Contains(Replace(DateTime.Now.ToShortDateString, "/", "")) Then
                e.Appearance.BackColor = Color.Pink
            End If
        End If
    End Sub

0个回答

打破零回复...

回复

登录 慧都网发表评论

扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP