P
Paul Bromley
I have written a similar enquiry to this newsgroup, but had no responses -
hence I will rephrase it with the hope that someone will answer.
I am new to using Classes, but trying hard to get the basics at the present
time, and seem to be winning.
Presently I am developing a Usercontrol for use in my application. To keep
it simple, let me give as an example - I have 3 command buttons in the User
Control. Each of these will have separate code in the click vent. However, I
wish to trigger a common event off in my external application once I press
one of these command buttons - i.e. I need to be able to create a new
instance of an existing class in my external application and send this
parameters. It may be a simple thing to do, but I am stuck - can soemone
send me a few clues as to how to achive this.
A few basic things on Classes that I need to get into my head:-
Is it bad practice to create n instance of class in the load event of a
form and re-use this?? Is best practice to create a new instance as and when
I need it.
Should I be setting the instance of the calss to Nothing once I have used
it.
I now understand about setting and getting the Properties within the Class
and using these properties in my application. The question is - can you do
the same with Methods, and if so how do you have acess to them externally,
or is this what I should be avoiding within a class? I was wondering whether
this was the way to go with my qustion at the top, but creating a Public Sub
in my Class does not expose it to my program.
Sorry if all the above appears rather obvious or silly to some. My
programming is set in the past, and may appear to be childish to others - I
am therefore trying to take this in hand, and to get Classes right from the
beginning. Anyone know of any useful on plain english links on Classes on
the Web?
Thanks in anticipation.
Paul Bromley
hence I will rephrase it with the hope that someone will answer.
I am new to using Classes, but trying hard to get the basics at the present
time, and seem to be winning.
Presently I am developing a Usercontrol for use in my application. To keep
it simple, let me give as an example - I have 3 command buttons in the User
Control. Each of these will have separate code in the click vent. However, I
wish to trigger a common event off in my external application once I press
one of these command buttons - i.e. I need to be able to create a new
instance of an existing class in my external application and send this
parameters. It may be a simple thing to do, but I am stuck - can soemone
send me a few clues as to how to achive this.
A few basic things on Classes that I need to get into my head:-
Is it bad practice to create n instance of class in the load event of a
form and re-use this?? Is best practice to create a new instance as and when
I need it.
Should I be setting the instance of the calss to Nothing once I have used
it.
I now understand about setting and getting the Properties within the Class
and using these properties in my application. The question is - can you do
the same with Methods, and if so how do you have acess to them externally,
or is this what I should be avoiding within a class? I was wondering whether
this was the way to go with my qustion at the top, but creating a Public Sub
in my Class does not expose it to my program.
Sorry if all the above appears rather obvious or silly to some. My
programming is set in the past, and may appear to be childish to others - I
am therefore trying to take this in hand, and to get Classes right from the
beginning. Anyone know of any useful on plain english links on Classes on
the Web?
Thanks in anticipation.
Paul Bromley