Change Forecolor in Listview Lines.


Author
Message
Marcio Valerio Silva
Marcio Valerio Silva
StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)StrataFrame Novice (83 reputation)
Group: Forum Members
Posts: 55, Visits: 929
I need to change Forecolor in Listview Lines, during population acording a condition.

For example if a payment date is minor than actual date the line of ListView its should be red if not it should  be Blue, but How Can i do this?

at,

Marcio Valerio da Silva
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Marcio,

Take a look at the RowPopulating and RowPopulated events of the listview in the help file.

Here is a sample event from one of my forms:

  Private Sub lstTransactions_RowPopulating(ByVal e As MicroFour.StrataFrame.UI.Windows.Forms.RowPopulatingEventArgsHandles lstTransactions.RowPopulating
        Using loBO As bizTransaction = DirectCast(e.BusinessObject, bizTransaction)
            e.UseGroup = True
            e.GroupHeaderText = MicroFour.StrataFrame.Tools.Common.GetEnumDisplayValue(loBO.TransactionType)
            e.ImageKey = loBO.TransactionType.ToString

            Select Case loBO.TransactionType
                Case Business.Enumerations.TransactionType.CarrierDeactivation
                    e.RowBackColor = Color.Yellow
                    Me.lblDeactivated.Text = "*** This card has been Deactivated ***"
                    Me.lblDeactivated.Visible = True
                    My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Exclamation)

                Case Business.Enumerations.TransactionType.FirstUseImport
                    e.RowBackColor = Color.Yellow
                    Me.lblDeactivated.Text = "*** This card has been Used ***"
                    Me.lblDeactivated.Visible = True
                    My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Exclamation)
            End Select
        End Using
    End Sub


Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search