{"id":525,"date":"2005-04-08T23:36:24","date_gmt":"2005-04-08T21:36:24","guid":{"rendered":"http:\/\/10.0.0.2\/wordpress\/?p=525"},"modified":"2005-04-08T23:36:24","modified_gmt":"2005-04-08T21:36:24","slug":"bitten_by_private","status":"publish","type":"post","link":"https:\/\/www.switchbl8.nl\/blog\/2005\/04\/bitten_by_private\/","title":{"rendered":"Bitten by &#8220;private&#8221;"},"content":{"rendered":"<p>I&#8217;ve just been bitten by private declarations. When doubleclicking a component on a form, let&#8217;s say a button, you will be given a framework for the code and you can type what you like. In Delphi, you can reference libraries (without having to use the full prefix) that are in the uses-list. In C# you can not. The generated event (button1_Click) is defined as private, which (I have to look it up for the exact scoping) means that you cannot just use the objects\/functions that you thought you&#8217;d included by &#8220;using&#8221; them.<\/p>\n<p>Solution (it&#8217;s very simple, I know, but one has to learn one step at a time): create a new function, declared as public, and call that function from the event.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve just been bitten by private declarations. When doubleclicking a component on a form, let&#8217;s say a button, you will be given a framework for the code and you can type what you like. In Delphi, you can reference libraries (without having to use the full prefix) that are in the uses-list. In C# you <a href='https:\/\/www.switchbl8.nl\/blog\/2005\/04\/bitten_by_private\/' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39,41,8],"tags":[],"class_list":["post-525","post","type-post","status-publish","format-standard","hentry","category-c","category-delphi","category-development","category-39-id","category-41-id","category-8-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/www.switchbl8.nl\/blog\/wp-json\/wp\/v2\/posts\/525","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.switchbl8.nl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.switchbl8.nl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.switchbl8.nl\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.switchbl8.nl\/blog\/wp-json\/wp\/v2\/comments?post=525"}],"version-history":[{"count":0,"href":"https:\/\/www.switchbl8.nl\/blog\/wp-json\/wp\/v2\/posts\/525\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.switchbl8.nl\/blog\/wp-json\/wp\/v2\/media?parent=525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.switchbl8.nl\/blog\/wp-json\/wp\/v2\/categories?post=525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.switchbl8.nl\/blog\/wp-json\/wp\/v2\/tags?post=525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}