M
Matt Michael
Hi,
I'm having a problem working with a listview in an application I'm writing.
Currently, whenever the selectedindex changed event fires, it loads up a
htmledit control, and other labels on the form, with the current information
associated with the listview item. The control is called HtmlEdit and it
references Microsoft.Mshtml Whenever I click on each item, it works fine,
but it seems that whenever I use the up/down arrows(important) to scroll
through the list, it loses focus, and goes to the htmledit control
whenever the index changes. The problem is that this control receives focus
after I select a message,
and rather I would like to be able to scroll through the list without losing
focus with the down and up arrows, with all the data being refreshed each
time a new item is selected.
-Matt
Sample code:
Private Sub lvMessages_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles lvMessages.SelectedIndexChanged
If lvMessages.SelectedItems.Count > 0 Then
....get message..
If msg.Tables("Message").Rows.Count > 0 Then
...display fields
...enable appropriate buttons
deMessage.LoadDocument(body)
End If
Else
....empty message fields..
...disable buttons
End If
End Sub
I'm having a problem working with a listview in an application I'm writing.
Currently, whenever the selectedindex changed event fires, it loads up a
htmledit control, and other labels on the form, with the current information
associated with the listview item. The control is called HtmlEdit and it
references Microsoft.Mshtml Whenever I click on each item, it works fine,
but it seems that whenever I use the up/down arrows(important) to scroll
through the list, it loses focus, and goes to the htmledit control
whenever the index changes. The problem is that this control receives focus
after I select a message,
and rather I would like to be able to scroll through the list without losing
focus with the down and up arrows, with all the data being refreshed each
time a new item is selected.
-Matt
Sample code:
Private Sub lvMessages_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles lvMessages.SelectedIndexChanged
If lvMessages.SelectedItems.Count > 0 Then
....get message..
If msg.Tables("Message").Rows.Count > 0 Then
...display fields
...enable appropriate buttons
deMessage.LoadDocument(body)
End If
Else
....empty message fields..
...disable buttons
End If
End Sub