Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi TcxCombobox - OnEnter (mit Mouse) SelectAll fkt nicht (https://www.delphipraxis.net/99545-tcxcombobox-onenter-mit-mouse-selectall-fkt-nicht.html)

heri 13. Sep 2007 17:54


TcxCombobox - OnEnter (mit Mouse) SelectAll fkt nicht
 
Ich habe eine TCombobox, wenn ich diese mit der Maus anklicke ist der ganze Textinhalt markiert
-> that's ok!

but:

Ich habe noch eine TcxCombobox (von DevExpress), wenn ich diese mit der Maus anklicke ist leider NICHT der ganze Textinhalt markiert
-> that's NOT ok!

PS: und selbst wenn ich im OnEnter noch ein SelectAll hinzuprogge nützt's nichts

weiss jemand Rat?

ausser die TcxCombobox gegen eine TCombobox auszutauschen :wink:

heri 13. Sep 2007 20:28

Re: TcxCombobox - OnEnter (mit Mouse) SelectAll fkt [done]
 
Never forget the InnerControl by DevExpress! :wall:
deshalb in OnEnter:
PostMessage( cxComboBox1.InnerControl.Handle, EM_SETSEL, 0, -1);


der ganze Code lautet dann:
Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
begin

  OldProgressWndProc := cxComboBox1.InnerControl.WindowProc; // alte merken
  cxComboBox1.InnerControl.WindowProc := ProgressWndProc; // wndproc umbiegen

end;


procedure TForm1.FormDestroy(Sender: TObject);
begin

  cxComboBox1.InnerControl.WindowProc := OldProgressWndProc;

end;

procedure TForm1.ProgressWndProc(var Msg: TMessage);
begin

  OldProgressWndProc (Msg);

  if Msg.Msg=514 then
     PostMessage( cxComboBox1.InnerControl.Handle, EM_SETSEL, 0, -1);

end;
naja - das ist bestimmt kein Highlite - aber es funktioniert einigermassen!
und falls jemand was besseres hat, wäre ich froh darum


Alle Zeitangaben in WEZ +1. Es ist jetzt 17:03 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz