Einzelnen Beitrag anzeigen

SneakL8

Registriert seit: 11. Feb 2016
24 Beiträge
 
#1

Offene TDBLookupComboBox verursaxht Exception bei ESC-Taste

  Alt 1. Mai 2017, 18:48
Hallo zusammen,

ich habe einen modalen Dialog mit "Abbrechen"-Button mit Cancel-Eigenschaft. Auf diesem Dialog befindet sich eine TDBLookupComboBox. Wenn ich diese zur Laufzeit aufklappe und dann die Esc-Taste drücke, erhalte ich eine EInvalidOperation-Exception "Ein deaktiviertes oder unsichtbares Fenster kann nicht den Fokus erhalten.".

Anbei der CallStack:
00511a19 +059 TG.exe Forms 4782 +4 TCustomForm.SetFocus
0050f94e +02e TG.exe Forms 3803 +3 TCustomForm.FocusControl
004f5850 +020 TG.exe Controls 7779 +3 TWinControl.SetFocus
00558663 +04f TG.exe DBCtrls 5146 +4 TDBLookupComboBox.CloseUp
0055967e +01e TG.exe DBCtrls 5509 +2 TDBLookupComboBox.WMKillFocus
004eeaa3 +1df TG.exe Controls 4645 +53 TControl.WndProc
004f27d2 +18e TG.exe Controls 6342 +33 TWinControl.WndProc
004f23a4 +034 TG.exe Controls 6237 +3 TWinControl.MainWndProc
0048bfe0 +014 TG.exe Classes 10966 +8 StdWndProc
775a8e54 +034 ntdll.dll KiUserCallbackDispatcher
0050fcc3 +03f TG.exe Forms 3891 +4 TCustomForm.SetWindowFocus
0050fd74 +080 TG.exe Forms 3906 +9 TCustomForm.SetActive
00510747 +02f TG.exe Forms 4168 +2 TCustomForm.WMActivate
004eeaa3 +1df TG.exe Controls 4645 +53 TControl.WndProc
004f27d2 +18e TG.exe Controls 6342 +33 TWinControl.WndProc
0050ddb8 +478 TG.exe Forms 3098 +103 TCustomForm.WndProc
004f23a4 +034 TG.exe Controls 6237 +3 TWinControl.MainWndProc
0048bfe0 +014 TG.exe Classes 10966 +8 StdWndProc
775a8e54 +034 ntdll.dll KiUserCallbackDispatcher
00511cef +283 TG.exe Forms 4843 +44 TCustomForm.ShowModal
005f7e78 +02c TG.exe UpdateForm 244 +4 TUpdForm.ShowModal
006605f7 +037 TG.exe TGStandard 711 +15 TTGStandardForm.ShowModal
00660248 +778 TG.exe TGStandard 662 +181 TTGStandardForm.CreateEx
0065fa7e +08a TG.exe TGStandard 460 +2 TTGStandardForm.Create
0066521b +04f TG.exe TGStandard 2201 +5 TTGStandardForm.CreateEditDlg
006653eb +05b TG.exe TGStandard 2236 +7 TTGStandardForm.DoKorr
0065d9f8 +020 TG.exe TGMain 2250 +3 TTGMainForm.KorrActionExecute
0048b085 +01d TG.exe Classes 10464 +3 TBasicAction.Execute
[...]

Nach einigen Tasts und Analyse sieht es für mich so aus als wenn die Esc-Taste durch den Cancel-Button zuerst das modale Formular schließt und danach die TDBLookupComboBox, ihre Auswahlliste und dabei den Focus an das modale Fenster zurückgeben will (Form.SetFocus), das aber gerade schon geschlossen wurde.

Ich hab schon geschaut, ob ich da irgendwetwas falsch mache, bin aber derzeit keine Schuld bewusst. Ist das evtl. ein Fehlverhalten der DBLookupComboBox? Tante Googlelieft mir dafür aber leider keine Anhaltspunkte.

Habt Ihr einen Tipp für mich?

Das passiert unter Delphi 7.01 (ich weiß, ist alt...).

Viele Grüße
Sneak-L8
  Mit Zitat antworten Zitat