...scroll a TScrollBox with the Up/Down arrows?

Author: P. Below
Homepage: http://www.teamb.com

Category: VCL

private
  procedure 
CMDialogKey(var Msg: TCMDialogKey); message CM_DIALOGKEY;
end;


implementation

procedure 
TForm1.CMDialogkey;
begin
  with 
Scrollbox1.VertScrollBar do
  begin
    case 
Msg.CharCode of
      
// Delphi takes care of Position < 0 or Position > Range
      
VK_DWON: Position := Position + Increment; // down arrow key
      
VK_Up: Position   := Position - Increment; // up arrow key
      
else
        inherited
;
    end;
  end;
end;

 

printed from
www.swissdelphicenter.ch
developers knowledge base