On 1/9/15, Marc Santhoff <m.santh...@web.de> wrote: > Yes, but if it is done in Form.OnCreate is is (here).
No, it does not (with fpc 2.6.4/win32) > Here we go: > fpc 2.6.2 > Lazarus 1.2.0, x86_64-gtk2 > FreeBSD 9 amd64 So, might be WS related. > tasks: array [0..taskmax] of string = ( > 'Tudies', > 'Tudas', > 'Sonstwas' > ); > > implementation > > procedure TForm1.FormCreate(Sender: TObject); > var > i: longword; > begin > tasklist := TStringList.create; > for i:=0 to taskmax do tasklist.add(tasks[i]); > ListBox1.Items.Assign(tasklist); > end; > Tried that, no OnSelectionChange. Workaround would be like: procedure TForm1.FormCreate(Sender: TObject); var i: longword; begin tasklist := TStringList.create; for i:=0 to taskmax do tasklist.add(tasks[i]); ListBox1.OnSelectionChange := nil; ListBox1.Items.Assign(tasklist); ListBox1.OnSelectionChange := @ListBox1SelectionChange; end; If the InvokeAction only is supposed to be as a respons to the user clicking, you could also check the User parameter. Bart -- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus