mlittler
asked on
highlight new items in listbox
Is it possible to set the text format to bold for individual rows in a list box?
I am trying to recreate something like Outlook in an Access form, and so I want new entries in the list box to appear in bold, until they are clicked on (like new emails are in bold in Outlook). Is this possible?
I am trying to recreate something like Outlook in an Access form, and so I want new entries in the list box to appear in bold, until they are clicked on (like new emails are in bold in Outlook). Is this possible?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
try modifying the code above to find the selected item and unbold it.
For Each li In lstView.ListItems
If li.Text = "Row2" Then
li.Bold = False
Next
li.ForeColor = vbRed
li.Bold = True
End If
Next
For Each li In lstView.ListItems
If li.Text = "Row2" Then
li.Bold = False
Next
li.ForeColor = vbRed
li.Bold = True
End If
Next
try modifying the code above to find the selected item and unbold it.
For Each li In lstView.ListItems
If li.Text = "Row2" Then
li.Bold = False
Next
li.ForeColor = vbRed
li.Bold = True
End If
Next
For Each li In lstView.ListItems
If li.Text = "Row2" Then
li.Bold = False
Next
li.ForeColor = vbRed
li.Bold = True
End If
Next
oops, that was a mispost.
For Each li In lstView.ListItems
If li.Text = Me.lstView.ItemData(Me.lst View.Selec ted(x)) Then
li.Bold = False
Exit For
End If
Next
I don't know (or even think) that this will work because I used some properties/collections that I don't think that are for list view, but I'm not sure.
Andrew
For Each li In lstView.ListItems
If li.Text = Me.lstView.ItemData(Me.lst
li.Bold = False
Exit For
End If
Next
I don't know (or even think) that this will work because I used some properties/collections that I don't think that are for list view, but I'm not sure.
Andrew
I created a sample form and put that code in, it seems to work for me
Have you thought of using the FlexGrid, its more powerful because of its formatting features
or maybe the listview control (reference "Microsoft Widows Common Controls" )