C
Christian H
Hi!
I've created a custom control (myDrawControl) that deals with drawing.
This control is then added to a form( myMainForm)
Now, whenever something is dragged and dropped onto myDrawControl , I want
to update a variable in myMainForm that keeps track of the objects that have
been added.(ArrayList objectsAdded)
Now I'm a little confused... How can I do this, when the method that deals
with drag&Drop for myDrawControl is not in the same class as the variable
"objectsAdded" I'm trying to access..? The custom control knows nothing
about the class that is using it, so how can this be accessed?
Do I have to add the "objectsAdded" variable as a reference to my control in
order to do this? So that I'll have a method setObjRef(ref myobject) in this
class? What are my options?
I have never really used custom controls before, so this was new to me. I've
been used to having all of the methods that performs an event on the control
, in the same class.
Regards Christian H.,
I've created a custom control (myDrawControl) that deals with drawing.
This control is then added to a form( myMainForm)
Now, whenever something is dragged and dropped onto myDrawControl , I want
to update a variable in myMainForm that keeps track of the objects that have
been added.(ArrayList objectsAdded)
Now I'm a little confused... How can I do this, when the method that deals
with drag&Drop for myDrawControl is not in the same class as the variable
"objectsAdded" I'm trying to access..? The custom control knows nothing
about the class that is using it, so how can this be accessed?
Do I have to add the "objectsAdded" variable as a reference to my control in
order to do this? So that I'll have a method setObjRef(ref myobject) in this
class? What are my options?
I have never really used custom controls before, so this was new to me. I've
been used to having all of the methods that performs an event on the control
, in the same class.
Regards Christian H.,