{"id":122,"date":"2007-05-12T14:36:55","date_gmt":"2007-05-12T12:36:55","guid":{"rendered":" http:\/\/www.nsonic.de\/blog\/2007\/05\/new-tform-with-new-properties\/"},"modified":"2007-05-12T14:36:56","modified_gmt":"2007-05-12T12:36:56","slug":"new-tform-with-new-properties","status":"publish","type":"post","link":"https:\/\/www.nsonic.de\/blog\/2007\/05\/new-tform-with-new-properties\/","title":{"rendered":"New TForm with new Properties"},"content":{"rendered":"<p><em>Q:<br \/>\nI have created a new TForm class called TNewForm. And added a few published<br \/>\nproperties. Then added it to repository.<br \/>\nNow, what should I do to see those properties in Object Inspector?<\/p>\n<p>Can anyone advise me on how to create a new form component (based on >TForm),<br \/>\nthat i can use in my projects and put other controls on it<br \/>\nduring design time?<br \/>\n<\/em><\/p>\n<p><b>A1:<\/b><br \/>\nYou need to register your new class as a custom module using<br \/>\nRegisterCustomModule. Search these groups using<br \/>\nhttp:\/\/www.dejanews.com for &#8220;RegisterCustomModule&#8221; and you should find<br \/>\nsome code samples as well.<\/p>\n<p><b>A2:<\/b><br \/>\nYou need to register the form with the IDE.<br \/>\n1) Publish the property or event.<br \/>\n2) Add the Custom form to the Object repository.<br \/>\n3) Add the form to a package [eventually create a new (design time)<br \/>\npackage]<br \/>\n4) Add to the package the following Register procedure<\/p>\n<p>[code lang=&#8221;delphi&#8221;][interface]<br \/>\nprocedure Register;<\/p>\n<p>[implementation]<br \/>\nuses dsgnIntf;<br \/>\nprocedure Register;<br \/>\nbegin<br \/>\n  RegisterCustomModule(TMyCustomForm, TCustomModule);<br \/>\nend;<br \/>\n[\/code]<br \/>\n5) Install the package in Delphi<br \/>\n6) Create a new form that inherits (make sure that you do not copy or<br \/>\nuse) from your custom form. You should now see the extra events and<br \/>\nproperties.<\/p>\n<p>[tags]Delphi, Forms[\/tags]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Q: I have created a new TForm class called TNewForm. And added a few published properties. Then added it to repository. Now, what&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[11],"tags":[75,100],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p71Tml-1Y","_links":{"self":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/122"}],"collection":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/comments?post=122"}],"version-history":[{"count":0,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/122\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/media?parent=122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/categories?post=122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/tags?post=122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}