Jump to content
Lainkes

Replace TCheckBox with TDBCheckBox

Recommended Posts

Hello,

 

I have a lot of TCheckBox components. Now I want to change them all to TDBCheckBox components.

Is just changing the type in my TForm class enough? Or do I need to do more?

 

Thanks for your feedback

 

Lainkes

Share this post


Link to post
5 minutes ago, Lainkes said:

Hello,

 

I have a lot of TCheckBox components. Now I want to change them all to TDBCheckBox components.

Is just changing the type in my TForm class enough? Or do I need to do more?

 

Thanks for your feedback

 

Lainkes

You have to change the type both in the form pas and dfm files.

Share this post


Link to post

Just change the type only in *.pas. Close it and open *.dfm. Then confirm all prompts.
I have tried it. It's not from my mind.

Edited by Stano

Share this post


Link to post
1 hour ago, Stano said:

Just change the type only in *.pas. Close it and open *.dfm. Then confirm all prompts.
I have tried it. It's not from my mind.

In which version of Delphi?  For me the IDE want to keep the class from the dfm.

 

What's working for me is to select View as text to show the dfm (alt+f12) change the class for components and then switch back to pas and save the file then will Delphi ask to change the pas. A bit faster solution is to use refind with rules #migrate. 

 

Of couse you have to add dataset, datafield, valuechecked and valueunchecked properties.

Share this post


Link to post

I just realized that I wrote it the other way around. Just change the *.dfm. No *.pas.
I apologise.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×