1.6.4 form oncreate issue? lazarus / 31-LCL ---------------------------------------------------------------------- snorkel · 2017-03-07 22:47 I looked in the release notes and did not notice anything, but I compiled one of my apps with 1.6.4 and I noticed that the oncreate event for the forms is not behaving the same as before, it seemed in prior releases that the oncreate was the first thing to fire, now objects on the form are being created first before the oncreate fires. or it's an issue with tcombobox firing the onchange event with no items to add. Not sure yet, but the app ran fine yesterday when built with 1.6.2. ---------------------------------------------------------------------- mangakissa · 2017-03-08 10:01 FormCreate is not the same as OnCreate. The first is a procedure, the other a constructor. So Lazarus is doing exactly what it must do. ---------------------------------------------------------------------- Pascal · 2017-03-08 10:21 Quote from: snorkel on March 07, 2017, 11:47:37 pm... now objects on the form are being created first before the oncreate fires. That has always been the case for OnCreate. Nothing new here. ---------------------------------------------------------------------- snorkel · 2017-03-08 13:52 Well, the behavior is different than 1.6.2... I am talking about the oncreate handler for a form, when you double click on it in the events tab it creates a handler called formcreate or similar and the order that it's being called is different. Just reporting what I have observed,  it could be some other changes in 1.6.4 that are causing it like the combo box onchange firing with no items added.  I will dig more into it today. Bottom line is the code worked yesterday and for years going through each release of Lazarus. ---------------------------------------------------------------------- snorkel · 2017-03-08 15:58 Well, I got it working. turned out it was something with the tdatetime picker control. I have it sharing it's onchange with some comboboxes and it's onchange was firing before the forms oncreate event. I had to uncheck it's DefaultToday property to stop it from firing it's onchange.  Once I did that the app works like it did before. I don't think that property is new, so it still could be the forms oncreate is not firing first.  I don't have time to dig into in further so let's just keep in mind this is just behavior I observed after upgrading to 1.6.4 ---------------------------------------------------------------------- Bart · 2017-03-08 16:13 Quote from: snorkel on March 08, 2017, 04:58:26 pmturned out it was something with the tdatetime picker control. I have it sharing it's onchange with some comboboxes and it's onchange was firing before the forms oncreate event. I had to uncheck it's DefaultToday property to stop it from firing it's onchange.  Once I did that the app works like it did before. Pease file a bugreport about that (and attach a minimal testcase). Bart ---------------------------------------------------------------------- snorkel · 2017-03-08 16:42 ok, if I have time. I just compiled another app that uses the tdateedit control and had to uncheck the defaulttoday property, so that two instances of it so far. I always set the current date in the forms oncreate so maybe that property is new? ---------------------------------------------------------------------- Bart · 2017-03-08 17:01 IIRC then the old behaviour with DefaultToday was that it set the date to the date the program was built, which was rather odd. It now forces a correct date in the control in TDateEdit.Loaded. This can force the text to be changed. Bart ---------------------------------------------------------------------- Zoran · 2017-03-25 11:42 Quote from: snorkel on March 08, 2017, 04:58:26 pmturned out it was something with the tdatetime picker control. ... I had to uncheck it's DefaultToday property to stop it from firing it's onchange.  Once I did that the app works like it did before. TDateTimePicker doesn't have DefaultToday property, it's TDateEdit you are talking about, right? ---------------------------------------------------------------------- snorkel · 2017-05-02 20:49 yes, sorry TDateEdit.