Lainkes 0 Posted September 29, 2022 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
PeterBelow 238 Posted September 29, 2022 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
Stano 143 Posted September 29, 2022 (edited) 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 September 29, 2022 by Stano Share this post Link to post
Lajos Juhász 293 Posted September 29, 2022 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
Stano 143 Posted September 29, 2022 That was in D10. I didn't do that in D11. Share this post Link to post
Lajos Juhász 293 Posted September 29, 2022 I did it in previous versions mostly XE5 and D2007 and always you have to change dfm then pas can be done by delphi. Share this post Link to post
Stano 143 Posted September 29, 2022 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
PaPaNi 23 Posted September 29, 2022 If you have GExpert installed, than use GExperts ->Replace Components 1 Share this post Link to post