I have a listview1 and below it i have a frame. Inside that frame i have a few controls such as textbox,web browser control,listview and button. My intention is to make the frame invisible when user haven't selected a row in listview1 both using right click or left click over listview row. However, using the code below i am facing a few problems:

1)the left click never works.if i left click over row nothing happens(frame doesn't become visible) .If i left click on the white area of listview the frame does become invisible!!( Note: right click works in make frame visible and invisible)

2)Both left click and right click doesn't un highlight the selected listview row.

Furthermore, i want to reload web browser and listview inside the frame on click of listview1 row .I be happy if some one help me fix these problem.Thanks




1 Code:
  1. Private Sub ListView1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  2.     Dim lvwItem As ListItem
  3.     If Button = vbRightButton Then
  4.         Set lvwItem = ListView1.HitTest(x, y)
  5.         If Not lvwItem Is Nothing Then
  6.             Frame1.Visible = True
  7.             lvwItem.Selected = True
  8.              PopupMenu mnuEdit
  9.         Else
  10.             Frame1.Visible = False
  11.         End If
  12.     End If
  13. End Sub