CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11

Threaded View

  1. #7
    Join Date
    May 2010
    Posts
    12

    Re: Listbox Item "top" position

    Quote Originally Posted by dglienna View Post
    He wants the TOP index?

    If it can show all 6 rows, it scrolls. Otherwise, it goes to the TOP
    ...
    [/CODE]
    (First READ the Thread, then answer. *********.)

    BTT: You could compute the Position where to put the Textbox using TextHeight like this :
    Code:
    Private Sub List1_DblClick()
      Dim nPos As Long
      Dim nIndex As Long
      
      nPos = List1.TopIndex
      nIndex = List1.ListIndex
      
      Text1.Top = List1.Top + ((nIndex - nPos) * TextHeight("Ag"))
      
    End Sub
    Last edited by HanneSThEGreaT; July 8th, 2010 at 03:18 AM.

Tags for this Thread

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

Featured