
Signature
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Hi Jeffrey,
Thanks for your posting!
> Does your "Drag&Drop event" refer to ControlDesigner's OnDrag*** methods?
> Or you implement some way yourself?
I override void OnDragDrop(DragEventArgs de) in the custom designer.
if I move a control on my GridLayout control,
Then de.Effect==DragDropEffects.Move and de.Data should (as I understand it)
contain the Control being dragged.
> I agree with Jerron that at design-time, the standard way of getting the
> selected object is using ISelectionService.
It just seems odd to me to have to go and make changes to the custom control
in order to get the selected controls from it,
instead of using the DrapEventArgs, that should have the information needed.
But I can't get the information from the de.Data.
No matter what parameter I pass to de.Data.GetData() it returns null.
> Also, do you still have any concern on this issue? Please feel free to tell
> me, thanks.
I've implemented it using ISelectionService, and it works.
It's just seems strange to do it like this...
Thanks,
Nadav
jer_m - 17 Jan 2005 18:26 GMT
Hi Nadav,
I agree, it does seem a little odd to use ISelectionService and it
would be nice to have some type of reference passed in DrapEventArgs.
>From what it looks like to me the drag and drop events are designed
more for dragging things like text into a text box rather then a
control onto another control. That's the only reason I can figure it's
not there. However, after using ISelectionService I found it really
accomplishes the same thing. Further more its a better fit when you
consider what happens when you select multiple controls and drop them
all on the parent at once.
You mentioned having to make changes to the custom control to implement
this. Are you just getting a reference to the ISelectionService in
your OnDragDrop function then calling getselectedcomponents or
primaryselection?
I'm happy you were able to get this working.
Kind Regards,
Jerron
> Hi Jeffrey,
>
[quoted text clipped - 22 lines]
> Thanks,
> Nadav
"Jeffrey Tan[MSFT]" - 18 Jan 2005 09:21 GMT
Hi Nadav,
Based on your feedback, it seems that you already got the workaround for
this issue. But do you still have concern on this issue? If you still feel
uncomfortable on this issue and need more information on it, I suggest you
provide a simple project and get rid of the un-related code to help me
reproduce out this issue. Then I can help you better.
Thanks
Best regards,
Jeffrey Tan
Microsoft Online Partner Support

Signature
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.