Apr 082005
 

I’ve just been bitten by private declarations. When doubleclicking a component on a form, let’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’d included by “using” them.

Solution (it’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.

 Posted by at 23:36

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)