Wednesday, 15 April 2015

.net - Must Lost Focus When no Item is Selected in a List View -



.net - Must Lost Focus When no Item is Selected in a List View -

i believe quite easy i'm having problems right now. have list view , every time click on item, i'm storing name on string variable. happens when click item on list view , click within list view 1 time again without selecting item, doesn't lost focus , stores name of previous selected item on string variable. want happen every time click item , click within or outside list view without selecting item, must lost focus , not store name of item on string variable.

private sub lvreceivedfiles_mouseclick(sender object, e system.windows.forms.mouseeventargs) handles lvreceivedfiles.mouseclick if e.button = windows.forms.mousebuttons.left if lvrecievedfiles.focuseditem.selected = true lvreceivedfiles.fullrowselect = true 'when item clicked in list view, store name. fname = "\" & path.getfilename(lvreceivedfiles.focuseditem.text) else 'this part here doesn't create sense because doesn't execute 'every time click in list view without selecting item. 'listview.focuseditem.selected true. end if end if end sub

you can seek in mouseup event.

private sub lvlcheckin_mouseup(sender object, e mouseeventargs) handles lvlcheckin.mouseup if e.button = windows.forms.mousebuttons.left if lvlcheckin.focuseditem.selected = true lvlcheckin.fullrowselect = true else lvlcheckin.fullrowselect = false end if end if end sub

.net vb.net listview lost-focus

No comments:

Post a Comment