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
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?
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.
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..
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.