<div dir="ltr">The following worked fine in Delphi. I can't get it to work in Lazarus. Tips, please!<div><br></div><div><br><div><p class="MsoNormal">  procedure
FormKeyDown(Sender: TObject; var Key: Word;</p>

<p class="MsoNormal">      Shift:
TShiftState);   </p>

<p class="MsoNormal">  const
FunctionKeys:array[vk_f1..vk_f12] of string[3]=</p>

<p class="MsoNormal">('F1','F2','F3','F4','F5','F6','F7','F8','F9','F10','F11','F12');</p>

<p class="MsoNormal">                  </p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">procedure TMain_Form.FormKeyDown(Sender: TObject; var Key:
Word;</p>

<p class="MsoNormal">  Shift: TShiftState);</p>

<p class="MsoNormal">  var
show_string:string;</p>

<p class="MsoNormal">begin</p>

<p class="MsoNormal">str(key,show_string);</p>

<p class="MsoNormal">If messagedlg('Key
Pressed='+show_string,mtconfirmation,[mbok,mbabort],0)=mrabort then halt;</p>

<p class="MsoNormal">if Key=vk_f1 then agentbuttonclick(application);</p>

<p class="MsoNormal">if Key=vk_f2 then custom_form.CreateCar('Cars');</p>

<p class="MsoNormal">if Key=vk_f3 then custom_form.CreateDeal('Deal');</p>

<p class="MsoNormal">if Key=vk_f4 then f4panelclick(application);</p>

<p class="MsoNormal">if key=vk_f5 then custom_form.CreateAgent('Insurance
Agent');</p>

<p class="MsoNormal">if key=vk_f6 then custom_form.CreatePreset('Presets');</p>

<p class="MsoNormal">if key=vk_f7 then custom_form.CreatePrinter('Print Forms');</p>

<p class="MsoNormal">if key=vk_f8 then begin
custom_form.F8PanelClick(application);top:=0;left:=0;vertscrollbar.Position:=0;end;</p>

<p class="MsoNormal">if key=vk_f9 then custom_form.F9Panelclick(application);</p>

<p class="MsoNormal">if key=vk_f10 then sendnamebuttonclick(application);</p>

<p class="MsoNormal">if key=vk_home then begin</p>

<p class="MsoNormal">if messagedlg('Home Key
Pressed',mtconfirmation,[mbok],0)=mrok then</p>

<p class="MsoNormal">top:=0;left:=0;vertscrollbar.Position:=0;</p>

<p class="MsoNormal">horzscrollbar.Position:=0; }</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">end;             </p></div></div></div>