Mega Code Archive

 
Categories / Delphi / VCL
 

Scroll a tscrollbox with the up-down arrows

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;