I'm getting a weird error at compilation when I try to set the Parent property of a BitBtn that's been created at runtime. Using Delphi 7 on Win7 64bit.
[Error] unitMainForm.pas(70): Incompatible types: 'TWidgetControl' and 'TMainForm'
I'm creating the BitBtn at runtime like this:
newButton := TBitBtn.Create(Self);
newButton.Parent := Self;
"Self" here being the form, named "MainForm". I'm getting this no matter what I put for a Parent. I've tried putting the current Form, ScrollBox, Panel. The same happens if I try to create a SpeedButton. The thing is, my code works as expected when I use TButtons, and even TImages, but not with TBitBtns or TSpeedButtons. TButtons and TImages accept the Form as their parent, and show up as expected. Any ideas? If it helps, I could provide a sample of the whole code, upon request.