Hi everyone...
I have a Winforms application in VB2005, and I have a group of textboxes (one for each month in the year) which obviously accept text. What I am trying to do is to allow the user to drag the content of one textbox into another (copy operation).
Now, the basic mechanics of that are all very well, but what I also need to do is to to check that the source control in this dragdrop is another one of my boxes. Afterall, I wouldn't want people to be dropping stuff from anywhere into my boxes...
The event args passed on the DragDrop event don't seem to support a means of telling where the data came from - which is a bit naff. I know that they have to cater for the fact that the data might come from another application, but surely an "InternalSource as control" property wouldn't have been so much to ask - it could be null for external sources...
So - anyone got any ideas how I can check where the data came from?
At the moment I'm considering passing a reference to the source control itself as the data, rather than merely it's text property. I could then do a if A is B test, but surely there has to be a more elegant solution?
Anyone?
lol
mmilan
I have a Winforms application in VB2005, and I have a group of textboxes (one for each month in the year) which obviously accept text. What I am trying to do is to allow the user to drag the content of one textbox into another (copy operation).
Now, the basic mechanics of that are all very well, but what I also need to do is to to check that the source control in this dragdrop is another one of my boxes. Afterall, I wouldn't want people to be dropping stuff from anywhere into my boxes...
The event args passed on the DragDrop event don't seem to support a means of telling where the data came from - which is a bit naff. I know that they have to cater for the fact that the data might come from another application, but surely an "InternalSource as control" property wouldn't have been so much to ask - it could be null for external sources...
So - anyone got any ideas how I can check where the data came from?
At the moment I'm considering passing a reference to the source control itself as the data, rather than merely it's text property. I could then do a if A is B test, but surely there has to be a more elegant solution?
Anyone?
lol
mmilan