[Lazarus] Formkeydown

Larry Dalton larrydalton71 at gmail.com
Fri Jun 12 18:17:02 CEST 2015


Will try that, but first problem is nothing happens when key pressed

Sent from my iPhone

> On Jun 12, 2015, at 11:02, Jürgen Hestermann <juergen.hestermann at gmx.de> wrote:
> 
> Am 2015-06-12 um 15:08 schrieb Larry Dalton:
> > The following worked fine in Delphi. I can't get it to work in Lazarus. Tips, please!
> What is the problem?
> 
> > const FunctionKeys:array[vk_f1..vk_f12] of string[3]= ('F1','F2','F3','F4','F5','F6','F7','F8','F9','F10','F11','F12');
> Where do you use FunctionKeys?
> 
> > if messagedlg('Home Key Pressed',mtconfirmation,[mbok],0)=mrok then
> >    top:=0;left:=0;vertscrollbar.Position:=0;
> What is intended here? Only the first statement ("top:=0") is omitted when the IF statement is false.
> All others are executed in all cases.
> 
> > horzscrollbar.Position:=0; }
> What comment ends here?
> 
> 
> Why not use a case statement instead of the many IF statements?
> For example:
> 
> ---------------------------
> Case Key of
>   vk_f1 : agentbuttonclick(application);
>   vk_f2 : custom_form.CreateCar('Cars');
>   vk_f3 : custom_form.CreateDeal('Deal');
>   vk_f4 : f4panelclick(application);
>   vk_f5 : custom_form.CreateAgent('Insurance Agent');
>   vk_f6 : custom_form.CreatePreset('Presets');
>   vk_f7 : custom_form.CreatePrinter('Print Forms');
>   vk_f8 : begin custom_form.F8PanelClick(application);top:=0;left:=0;vertscrollbar.Position:=0;end;
>   vk_f9 : custom_form.F9Panelclick(application);
>   vk_f10 : sendnamebuttonclick(application);
>   vk_home :
>      begin
>      if messagedlg('Home Key Pressed',mtconfirmation,[mbok],0)=mrok then
>         top:=0;
>      left:=0;
>      vertscrollbar.Position:=0;
>      horzscrollbar.Position:=0;
>      end;
>   end; // of case
> 
> 
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




More information about the Lazarus mailing list