Hello!
I believe this is a very basic question on VB.net and OOP But I think it will help me to trigger a deeper understanding of what's going on.
I'm essentially new to OOP and VB.net and most probably my question is not so well formulated, sorry for that.
So, I have implemented an easy Drag/Drop event handling between two Listboxes in Form1.vb.
As for now it operates only between the two listboxes that are specified in the "Handles" list.
but I would like to make it a more general code such that it can operate between any couple of listboxes that I'm interested to
so that I don't need to duplicate the code when I add another couple of listboxes in Form1.vb [design].
I'm aware that I should use some sort of Class to do this, but than, how should it be structured?
I'm referring especially to the events: let's say the code I've written uses subs that handle myListbox1.DragOver myListbox2.DragOver myListbox1.DragDrop... etc..
How do I structure the class so that to be sensible to events that occur between a custom couple of Listboxes?
Do I also need for example to add methods in order to specify the names of the listboxes between which I want the behavior to happen?
What I'm asking could be just also a hint that will let me understand which direction I should take to write my code.
I'm remaining very general with my questions but I can go deeper or add code as needed.
Thanks and Best Regards.
I believe this is a very basic question on VB.net and OOP But I think it will help me to trigger a deeper understanding of what's going on.
I'm essentially new to OOP and VB.net and most probably my question is not so well formulated, sorry for that.
So, I have implemented an easy Drag/Drop event handling between two Listboxes in Form1.vb.
As for now it operates only between the two listboxes that are specified in the "Handles" list.
but I would like to make it a more general code such that it can operate between any couple of listboxes that I'm interested to
so that I don't need to duplicate the code when I add another couple of listboxes in Form1.vb [design].
I'm aware that I should use some sort of Class to do this, but than, how should it be structured?
I'm referring especially to the events: let's say the code I've written uses subs that handle myListbox1.DragOver myListbox2.DragOver myListbox1.DragDrop... etc..
How do I structure the class so that to be sensible to events that occur between a custom couple of Listboxes?
Do I also need for example to add methods in order to specify the names of the listboxes between which I want the behavior to happen?
What I'm asking could be just also a hint that will let me understand which direction I should take to write my code.
I'm remaining very general with my questions but I can go deeper or add code as needed.
Thanks and Best Regards.