Autor Beitrag
Jojojoxx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 386



BeitragVerfasst: So 26.08.07 17:35 
Hallo!

Ich habe eine TCombobox mit dem Style DropDownList.
Leider wird weder das "OnSelect" noch die "OnChange" Ereignis ausgelöst, wenn ich diesen Code ausführe:

ausblenden Quelltext
1:
Combobox1.ItemIndex:=Combobox1.ItemIndex - 1;					


Welches Ereignis wird dadurch ausgelöst, oder was mache ich falsch?
Danke euch!
mfg

Jojo
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: So 26.08.07 23:13 
Moin!

Wenn die VCL das nicht als Ereignis behandelt, dann ruf´ halt nach der Änderung manuell den Handler auf... :nixweiss:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Jojojoxx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 386



BeitragVerfasst: Mo 27.08.07 01:21 
Stimmt! :D
Oft liegt die Lösung so nah! :)
Wobei es als Ereignis irgendwie eleganter gewesen wäre...
Danke für die Hilfe!
mfg

Jojo
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Mo 27.08.07 08:25 
naja, aber
ausblenden Delphi-Quelltext
1:
if Assigned(ComboBox1.OnChange) then ComboBox1.OnChange(ComboBox1)					

ist doch auch ganz elegant - find ich. Du musst ja nicht mal direkt die Ereignisbehandlungsroutine ComboBox1Change(ComboBox1) aufrufen, sondern eben das Ereignis.

//Edit: Fehler ausgebessert


Zuletzt bearbeitet von Jakob Schöttl am Mo 27.08.07 11:31, insgesamt 1-mal bearbeitet
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 27.08.07 08:54 
Moin!

user profile iconJakob Schöttl hat folgendes geschrieben:
naja, aber ComboBox1.OnChange(ComboBox1) ist doch auch ganz elegant - find ich. Du musst ja nicht mal direkt die Ereignisbehandlungsroutine ComboBox1Change(ComboBox1) aufrufen, sondern eben das Ereignis.

Dann gehört aber auch noch ein if Assigned()drum rum, sonst gibt das so benutzerunfreundliche AV-Dialoge, wenn kein Ereignis im OI zugewiesen ist... :mahn: :? und deshalb halte ich von diesem Vorschlag nix...

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Mo 27.08.07 11:29 
oh, ja hab ich jetzt ganz vergessen :O ... danke narses