User Tools

Site Tools


scrolling_20a_20list_20box

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

scrolling_20a_20list_20box [2018/03/31 13:19]
127.0.0.1 external edit
scrolling_20a_20list_20box [2018/04/15 19:02] (current)
tbest3112 Added syntax highlighting
Line 2: Line 2:
  
 //by Richard Russell, March 2007//\\ \\  You can scroll the contents of a list box, under the control of your own program, by sending it a **WM_VSCROLL** message. The simple program below illustrates the use of that technique:​\\ \\  //by Richard Russell, March 2007//\\ \\  You can scroll the contents of a list box, under the control of your own program, by sending it a **WM_VSCROLL** message. The simple program below illustrates the use of that technique:​\\ \\ 
 +<code bb4w>
         INSTALL @lib$+"​WINLIB5"​         INSTALL @lib$+"​WINLIB5"​
  
Line 18: Line 19:
           SYS "​SendMessage",​ hlist%, WM_VSCROLL, SB_BOTTOM, 0           SYS "​SendMessage",​ hlist%, WM_VSCROLL, SB_BOTTOM, 0
         UNTIL FALSE         UNTIL FALSE
 +</​code>​
 Here the **SB_BOTTOM** scroll command is sent, which causes the list box to scroll so the last item is in view. The full set of commands is as follows:\\ \\  Here the **SB_BOTTOM** scroll command is sent, which causes the list box to scroll so the last item is in view. The full set of commands is as follows:\\ \\ 
 +<code bb4w>
         SB_LINEUP = 0   : REM Scrolls one line up         SB_LINEUP = 0   : REM Scrolls one line up
         SB_LINEDOWN = 1 : REM scrolls one line down         SB_LINEDOWN = 1 : REM scrolls one line down
Line 25: Line 28:
         SB_TOP = 6      : REM Scrolls to the top         SB_TOP = 6      : REM Scrolls to the top
         SB_BOTTOM = 7   : REM scrolls to the bottom         SB_BOTTOM = 7   : REM scrolls to the bottom
 +</​code>​
 The code shown is appropriate for scrolling a list box on your main window. You can similarly scroll a listbox within a dialogue box by using **SendDlgItemMessage** as below:\\ \\  The code shown is appropriate for scrolling a list box on your main window. You can similarly scroll a listbox within a dialogue box by using **SendDlgItemMessage** as below:\\ \\ 
 +<code bb4w>
         SYS "​SendDlgItemMessage",​ !dlg%, idlist%, WM_VSCROLL, SB_BOTTOM, 0         SYS "​SendDlgItemMessage",​ !dlg%, idlist%, WM_VSCROLL, SB_BOTTOM, 0
 +</​code>​
scrolling_20a_20list_20box.txt ยท Last modified: 2018/04/15 19:02 by tbest3112