TFileNameEdit Execute Dialog through OnKeyDown lazarus / 31-LCL ---------------------------------------------------------------------- M+AUDIO · 2017-10-12 16:00 Hi, didn't wanted to bump this old thread. since the button part does not gets the focus, handling it in TFileNameEdit.OnKeyDown is the only way I have, I think. now my question is why such a hack? why TFileNameEdit.RunDialog is not public? what are those risks? ---------------------------------------------------------------------- JuhaManninen · 2017-10-12 16:14 What exactly do you want to achieve? There is also a separate TOpenDialog. No need to hack TFileNameEdit. ---------------------------------------------------------------------- M+AUDIO · 2017-10-12 16:41 so you suggest me to put a TOpenDialog + a TEdit + a TButton to do the job (opening a single file as input file)? instead of a single TFileNameEdit? I think TFileNameEdit is just fine.  I wanted to give the user also ability to work with his keyboard if he wants. hence the first post. ---------------------------------------------------------------------- M+AUDIO · 2017-10-12 17:17 P. S. It is not a big deal. I'm doing it this way: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i interface uses  ...EditBtn...  type  { TForm1 }  TForm1 = class(TForm)  ...  procedure MyFileNameEditKeyDown(Sender: TObject; var Key: Word;  Shift: TShiftState);  ...  end;   { TFileNameEditHelper }  TFileNameEditHelper = class helper for TFileNameEdit  public    procedure ShowDialog;  end;  implementation...{ TForm1 }procedure TForm1.MyFileNameEditKeyDown(Sender: TObject; var Key: Word;  Shift: TShiftState);begin  if (Key = VK_RETURN) and (Shift = [ssCtrl]) then  (Sender as TFileNameEdit).ShowDialog;end; ...{ TFileNameEditHelper }procedure TFileNameEditHelper.ShowDialog;begin  RunDialog;end;....  But you saying it is not going to be public for some reasons? OK that's it. Edit: class helper ---------------------------------------------------------------------- JuhaManninen · 2017-10-29 16:32 Quote from: M+AUDIO on October 12, 2017, 07:17:31 pm... But you saying it is not going to be public for some reasons? OK that's it. Edit: class helper Sorry, I missed some replies for my old posts. Yes, TFileNameEdit can be improved as needed. I just did not understand what you want to do. [Edit] Ok, now I read the text properly. For shortcut keys you indeed need a public RunDialog. I changed it in r56242. Please test. ---------------------------------------------------------------------- jamie · 2017-10-29 17:16 I believe its possible he is having a Focus issue.. I don't know where the RunDialog comes from but its best to use a KeyUp event instead for such things. That way the current focused control has completed before popping up another form, in this case it could be MODAL.  That is what I get out of that. ---------------------------------------------------------------------- M+AUDIO · 2017-10-30 08:48 Quote from: JuhaManninen on October 29, 2017, 05:32:08 pm[Edit] Ok, now I read the text properly. For shortcut keys you indeed need a public RunDialog. I changed it in r56242. Please test. Yes, that was what I was asking. Tested and its working now. thanks. jamie Focus issues yes, my first post was somehow cryptic indeed, and it needed more focus to get the idea. and Juha finally got it. thanks.