Tuesday, 15 March 2011

Delphi 7, Error when setting Form as a Parent of a BitBtn -



Delphi 7, Error when setting Form as a Parent of a BitBtn -

i'm getting weird error @ compilation when seek set parent property of bitbtn that's been created @ runtime. using delphi 7 on win7 64bit.

[error] unitmainform.pas(70): incompatible types: 'twidgetcontrol' , 'tmainform'

i'm creating bitbtn @ runtime this:

newbutton := tbitbtn.create(self); newbutton.parent := self;

"self" here beingness form, named "mainform". i'm getting no matter set parent. i've tried putting current form, scrollbox, panel. same happens if seek create speedbutton. thing is, code works expected when utilize tbuttons, , timages, not tbitbtns or tspeedbuttons. tbuttons , timages take form parent, , show expected. ideas? if helps, provide sample of whole code, upon request.

you mixing clx , vcl. button clx tbitbtn, form vcl form.

i don't know whether want app vcl app or clx app, whichever is, need parts of app come same framework.

my guess want vcl app. , somehow have used qbuttons, clx unit, rather buttons, vcl unit. , that's why getting clx version of tbitbtn.

so, assuming i'm guessing right, alter qbuttons buttons , code compile.

delphi delphi-7

No comments:

Post a Comment