Results 1 to 6 of 6

Thread: List box is not working

  1. #1
    Join Date
    Jun 2006
    Posts
    69

    List box is not working

    I have a developing an application. In this particular application I have used List box which is used to populate the database table. there are total 4 columns associated. I wanted to double click on any of the row so that I can capture any of the column data. However I cannot find which row has been double clicked? Let me know if you are having any specific information to get the requirement of mine. Thanks a lot in advance.

  2. #2
    Join Date
    Apr 2009
    Posts
    569

    Re: List box is not working

    Well looking at the situation which you have mentioned over here I am suggesting following code to get the requirement of yours.
    Code:
    MyLabel.Text = MyListbox.Cell(Row, Column)
    'Row gets the row taken from the event
    'Column gets the column taken from the event
    It will used to display column row1 on the label which is names as MyLabel.

  3. #3
    Join Date
    May 2009
    Posts
    529

    Re: List box is not working

    As far as I know List box is having double click event. Any user can double click on the List box. Also I wanted to share something which will give you a light shed on this particular matter. The indexes of the cell which has been doubleclicked is not passed rather you will be able to find the indexes by untilizing the RowFromXY and ColumnFromXY methods. So you should try the thing which I have mentioned over here.

  4. #4
    Join Date
    May 2009
    Posts
    543

    Re: List box is not working

    You can use the following code which is used for the double click event of the List box so that you will be able to deteremine the indexes which has been double clicked by the user.
    Code:
    Dim row,column as Integer
    row=Me.RowFromXY(System.MouseX - Me.Left - Self.Left, System.MouseY - Me.Top - Self.Top)
    column=Me.ColumnFromXY(System.MouseX - Me.Left - Self.Left, System.MouseY - Me.Top - Self.Top)
    MsgBox "You double-clicked in cell "+Str(row)+", "+Str(column)

  5. #5
    Join Date
    Jun 2006
    Posts
    69

    Re: List box is not working

    Well thanks a lot for the prompt replies of yours the double click option is working fine. It is displaying the coordinates of the mouse pointer. What thing should I use if any of the cell is being highlighted? Also there should be something which will allow me to get the row number. Let me know if you are having idea to get the requirement of mine. Anyway thanks a lot for the prompt replies of yours.

  6. #6
    Join Date
    May 2009
    Posts
    543

    Re: List box is not working

    After looking at the post I have done little bit research work and I have found that you need to make use of ListIndex. Also you can make use of the same on the double click event. For eg If you pressed keydown event then you should use the following code.
    Code:
    if key=chr(13) then
        msgbox str(me.ListIndex)
      end if
    So try the same and let me know whether it was useful to you.

Similar Threads

  1. Working with contacts and distribution list in Exchange Server
    By AapHo in forum Small Business Server
    Replies: 4
    Last Post: 16-02-2012, 11:55 PM
  2. Replies: 3
    Last Post: 23-08-2011, 01:06 AM
  3. Replies: 5
    Last Post: 17-08-2011, 08:21 AM
  4. “Back” button drop-down list not working on IE9.
    By BaBHUshA in forum Technology & Internet
    Replies: 4
    Last Post: 18-04-2011, 10:48 AM
  5. Replies: 1
    Last Post: 21-09-2008, 09:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,448,521.66803 seconds with 16 queries