Results 1 to 7 of 7

Thread: problems with ListView1_MouseDown

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    problems with ListView1_MouseDown

    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

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: problems with ListView1_MouseDown

    Quote Originally Posted by tony007
    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)
    What code do you have in the Listview click event? That is what will fire when you left click.
    Quote Originally Posted by tony007
    2)Both left click and right click doesn't un highlight the selected listview row.
    That makes perfect sense. Selecting a row will highlight it, not unhighlight it.
    Quote Originally Posted by tony007
    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.
    I have no idea what this is about. What does a webbrowser have to do with using your listview?

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Re: problems with ListView1_MouseDown

    What code do you have in the Listview click event? That is what will fire when you left click.
    The code below belongs to listview1 client event.How to tell this code to make frame visible when i left click on listview row?
    or how to tell this code to make frame invisible when i left click over white area of listview where there is no row?

    1 Code:
    1. Private Sub ListView1_Click()
    2. gstrSomething = ListView1.SelectedItem.SubItems(4)
    3. gstrSomethingElse = ListView1.SelectedItem.Text
    4. End Sub
    That makes perfect sense. Selecting a row will highlight it, not un highlight it.
    opps. I mean how to un highlight the row when i left click or right click white area of listview where
    there is no row?

    I have no idea what this is about. What does a web browser have to do with using your listview?
    I 2 have web browser control and listview inside frame.Their values depend on listview1 4th and
    first column. So i want them to get those data and load corespondent web page when i right click or
    left click a particular row.Right now those web browsers doesn't load correct page because
    no data reached them and they did reload to display the correct pages!!

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: problems with ListView1_MouseDown

    Code:
    Private Sub ListView1_Click()
    gstrSomething = ListView1.SelectedItem.SubItems(4)
    gstrSomethingElse = ListView1.SelectedItem.Text
    Frame1.Visible = True
    End Sub

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Re: problems with ListView1_MouseDown

    Hack i already did that but how to unselect listview row and hide frame when i click(righit click or left click) on white area of listview where there is no row?

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: problems with ListView1_MouseDown

    White area?

    Are you talking about the space between the columns?

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Re: problems with ListView1_MouseDown

    Quote Originally Posted by Hack
    White area?

    Are you talking about the space between the columns?
    I mean space under the first row where there is not data. I attached a pic:
    Attached Images Attached Images  
    Last edited by tony007; May 11th, 2007 at 02:53 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width