On Fr, 2015-01-09 at 11:00 +0100, Bart wrote: > On 1/9/15, Marc Santhoff <[email protected]> wrote: > > > Yes, but if it is done in Form.OnCreate is is (here). > > No, it does not (with fpc 2.6.4/win32)
I'll see next time my Lazarus is updated. If the current version works with fpc 2.6.2 that could happen immeadiately. > 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; Tried that solution already, but it does not help. There must be something special later in the form creation chain, that forces selection on the listbox and in turn trigger SelectionChange. If the assignment of OnSelectionChange hanlder is done a bit later, in FormShow that is, it works as expected. Maybe something else regarding the creation of forms has changed inside LCL between Lazarus 1.2 and 1.3. > If the InvokeAction only is supposed to be as a respons to the user > clicking, you could also check the User parameter. Will do. -- Marc Santhoff <[email protected]> -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
