|
-
Jul 7th, 2004, 02:07 PM
#1
Thread Starter
Frenzied Member
make item have selected effect in listview when listview loses focus *RESOLVED*
does anyone know how to make an item in a listview appear selected after the listview loses focus. everytime i select an item in a listview and the listview loses focus, the item no longer appears selected even though it is, ie the highlighting disappears. can anyone tell me how to make it stay visiable.
thanx in advance
Last edited by vbdotnetboy; Jul 8th, 2004 at 09:25 AM.
-
Jul 7th, 2004, 04:25 PM
#2
PowerPoster
Hi
Put the following in the ListBox_SelectedIndexChanged event.
VB Code:
Dim item As ListViewItem
For Each item In LstDet.Items
item.ForeColor = LstDet.ForeColor
item.Font = New Font(LstDet.Font, FontStyle.Regular)
Next
LstDet.Items(LstDet.SelectedIndices(0)).Font = New Font(Font, FontStyle.Bold)
This will reset all List View entries to normal font and then highlight the last one selected. When the ListBox loses focus the highlight will remain.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Jul 8th, 2004, 04:29 AM
#3
I think this is the easiest way.
VB Code:
ListView1.HideSelection=False
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
-
Jul 8th, 2004, 05:14 AM
#4
PowerPoster
Originally posted by pax
I think this is the easiest way.
VB Code:
ListView1.HideSelection=False
You're right.
I'm sure I tried that recently and found that it was not satisfactory, but I can't remember why
Maybe I did not like the greying effect.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Jul 8th, 2004, 09:25 AM
#5
Thread Starter
Frenzied Member
thanx taxes and pax for the response. both methods helped solve my issue.
thanx again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|