Listbox help

Discussion in 'Programming General' started by htaed, Oct 1, 2008.

Listbox help
  1. Unread #1 - Oct 1, 2008 at 1:18 PM
  2. htaed
    Joined:
    Dec 19, 2005
    Posts:
    336
    Referrals:
    0
    Sythe Gold:
    0

    htaed Forum Addict
    Banned

    Listbox help

    Well i am just messing around with a few things, and when trying to make a log using the listbox, is there a way of it keeping scrolled to the latest item added to it?
     
  3. Unread #2 - Oct 2, 2008 at 1:36 AM
  4. Covey
    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Listbox help

    API's & Constants needed:
    Code:
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    Private Const WM_VSCROLL = &H115
    Private Const SB_BOTTOM = 7
    You will need to add this in the event where data gets added into your list box:
    Code:
    Call SendMessage(ListBox1.hWnd, WM_VSCROLL, SB_BOTTOM, Null)
     
  5. Unread #3 - Oct 2, 2008 at 2:20 AM
  6. Darthatron
    Joined:
    May 22, 2006
    Posts:
    1,612
    Referrals:
    3
    Sythe Gold:
    0

    Darthatron Massive Troll
    Retired Sectional Moderator Visual Basic Programmers

    Listbox help

    Of, if you don't wanna use API calls...

    Code:
    ListBox1.ListIndex = ListBox1.ListCount - 1
     
< Keypresses.... | Rotterdams Tutorials >

Users viewing this thread
1 guest


 
 
Adblock breaks this site