Listview selected listitem
have problem here, I have selected listitem in my listview and then I check the check the checkbox to true to update the record only this item, then the selected item in my listview is set clear.why? I want to the selected listitem retain the selected item in the listview when I check the checkbox to true.
Code:
Private Sub CheckBox1_Click()
If CheckBox1.value = False Then
Set ListView1.SelectedItem = Nothing
End If
End Sub
Re: Listview selected listitem
I don't understand your question.
Are you using a Checked ListView (a listview with checkboxs) as your question would indicate, or a check box control that somehow interacts with the listview as your code would indicate?
Re: Listview selected listitem
Is the HideSelection property set to True?
1 Attachment(s)
Re: Listview selected listitem
Yes, It hide selection is set to true. But I don't know how to change the highlight color.
Re: Listview selected listitem
:confused: Highlight color?? :confused:
What does that have to do with check boxes and selected items and such as asked in the original question?
Re: Listview selected listitem
Quote:
Originally Posted by matrik02
have problem here, I have selected listitem in my listview and then I check the check the checkbox to true to update the record only this item, then the selected item in my listview is set clear.why? I want to the selected listitem retain the selected item in the listview when I check the checkbox to true.
Code:
Private Sub CheckBox1_Click()
If CheckBox1.value = False Then
Set ListView1.SelectedItem = Nothing
End If
End Sub
If you want to keep it selected, why re you setting it to Nothing? Setting the SelectedItem to nothing clears the selection.
-tg
Re: Listview selected listitem
Quote:
Originally Posted by Hack
:confused: Highlight color?? :confused:
What does that have to do with check boxes and selected items and such as asked in the original question?
When I check the checkbox to false, then I want to clear the selected listitem. But then problem here, the check box is tick (true) then I point my cursor to the textbox to type the string, then the blue color clear. I don't why, I expected that when I move my cursor to the textbox and start typing in the textbox the blue color should not clear. I have to select it again..
Re: Listview selected listitem
Quote:
Originally Posted by Ellis Dee
Is the HideSelection property set to True?
Quote:
Originally Posted by matrik02
Yes, It hide selection is set to true. But I don't know how to change the highlight color.
There... you answered it right there.... HideSelection is turned on. that means that when the control loses focus, it "hides" the selection.... it's not that it isn't selected, jsut that the highlight isn't showing. Set this property to FALSE to keep the highlight when it loses focus.
-tg