> Benoit, > On the line "Dim txtTemp as Valuebox = LAST" I get an error "Expecting > valuebox got textbox" But the last control was a valuebox. > It works if I change the code to "Dim txtTemp as Textbox" even though it > is not a textbox firing the event.
OK I see! The ValueBox of Gambas 2 inherits TextBox, and so when it raises events, LAST is always a ValueBox. The current ValueBox of Gambas 3 is actually a compound control (it inherits UserControl), with a edit control inside that can be a TextBox or another control. Events raised by the edit control are propagated as if the ValueBox raise it. But then LAST is the read TextBox, not the ValueBox. Moreover, the code of that ValueBox is somewhat dirty. So I plan to rewrite it differently, and makes it inheriting TextBox again, or find a way to propagate events and keep LAST to be the ValueBox. Sorry for the inconvenience. It will disappear when the ValueBox will be rewritten. As a workaround, you can check the type of LAST. And when it is a TextBox, take its parent to get the ValueBox. Regards, > > Then I cannot read the "name" that I assigned to the valuebox. > txtTemp.Name just returns "Textbox". > > I tried replacing the valuebox with a DateBox but this appears to have a > bug. I can set the value of the DateBox in code and it displays > correctly. I can pick a value from the DatePicker and it displays > properly. But it does not have a .Text property to read so I read the > .Value property and it always returns "00:00:00" Maybe another bug then. I will investigate. Regards, -- Benoît Minisini ------------------------------------------------------------------------------ Lotusphere 2011 Register now for Lotusphere 2011 and learn how to connect the dots, take your collaborative environment to the next level, and enter the era of Social Business. http://p.sf.net/sfu/lotusphere-d2d _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user