What about if panel.Controls[j] is TSpinEdit then TSpinEdit(panel.Controls[j]).Value:=0;
[email protected] on Wednesday, 20 July 2005 at 0:00 +0000 wrote: >Message: 4 >Date: Mon, 18 Jul 2005 19:36:29 +0200 (MEST) >From: Hamar Gabor <[EMAIL PROTECTED]> >Subject: converting TControl to TWidgetControl >To: [email protected] >Message-ID: <[EMAIL PROTECTED]> >Content-Type: TEXT/PLAIN; charset=US-ASCII > >Hi, > >I have some TSpinEdit on a form. I would like to access the control >through the Controls list of its parent. > >I would like to do something like this: > >if panel.Controls[j] is TSpinEdit > then (panel.Controls[j] as TSpinEdit).Value:=0; > >This code doesn't colmpiles, the error message is: >Incompatible types: 'TSpinEdit' and 'TControl' > >If I use an other control, which is not derived from TWidgetControl this >code works fine. Does anybody has any recomandations? > >Thanks, >Gabor _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

