Breaking News
recent

Delphi forms change input language to default automatically

There is a bug appeared after upgrade from D2006 to D2010. When switching forms, the input language changes to default automatically. This is indeed very annoying for users uses with different localization than default.

This is how to disable automatic changing of keyboard layout.

1) find the unit DBGrids and open it

2) save it to your project folder with a different name e.g: untDBGrids

3) find the following code:

procedure TCustomDBGrid.WMKillFocus(var Message: TMessage);
begin
  ImeName := Screen.DefaultIme;
  ImeMode := imDontCare;
  inherited;
  if not ((InplaceEditor <> nil) and
    (HWND(Message.WParam) = InplaceEditor.Handle)) then
    ActivateKeyboardLayout(Screen.DefaultKbLayout, KLF_ACTIVATE);    

end;

4) remove the if block

  if not ((InplaceEditor <> nil) and
    (HWND(Message.WParam) = InplaceEditor.Handle)) then
    ActivateKeyboardLayout(Screen.DefaultKbLayout, KLF_ACTIVATE);   

5) Replace in uses clause the DBGRIDS with untDBGRIDS.




Προμηθέας

Προμηθέας

No comments:

Post a Comment

Please leave you comment to improve our services and support

Powered by Blogger.