Disable Drag and Drop

ST3VO
ST3VO used Ask the Experts™
on
Hi all,

Is there a way to disable drag and drop on a component please?

thx

S
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Hi. yeah Its possible. What I think is go to the properties of the control and from there you can uncheck the drag and drop property of the component.
sorry sorry. may I know which component are you working on.

Author

Commented:
Actually, I have checked the events and there is
no option. The is why I'm asking :-/
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Commented:
Hi,
   there is a great function in Delphi that let's you build this string with the standard ADO user interface. Use the code below:

Uses AdoConEd;

procedure TForm1.Button1Click(Sender: TObject);
begin
 if EditConnectionString(ADOConnection1) then
  ShowMessage(ADOConnection1.ConnectionString);
end;

Author

Commented:
Sorry but what does ADO connection got to do with Drag n Drop ???
Senior developer, analyst and customer assistance
Commented:
It was posted here instead of here http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_25096401.html I think.

Btw what do you mean? Do you want to disable the possibility to accept any dragged object? If so use the OnDragOver event writing in Accept := False;

i.e.
procedure TForm1.Panel1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
begin
accept := false;
end;

ok. Thats why I asked which component and on to which component you are dragging and dropping. or is it a third party component, you just mention clearly. so that experts can help you properly.
 Ferruccio68 has added one good solution. Some component has as these as property or implemented through some API. Follow the component features in Help files also.

Commented:
Sorry, wrong post on the wrong thread...

Author

Commented:
No probs! Anyway...


What I need to do is the following:

Using TEmbeddedWB or TWebBrowser or any other (they all using IE5 as editor) when you put them in Edit Mode ...

You can normally drag and drop etc...I besically need to stop this from happening...but I don't want to mess the user's IE settings.

Any ideas please?

thx

Commented:
Hi,
   now the post is for the correct thread. To disable droping on a TWebBrowser set the RegisterAsDropTarget property to False.

Author

Commented:
I'm actually using a third party component for it and it doesn't have a RegisterAsDropTarget property.

The component is based heavily on MSHTML. I really thought it was a matter of disabling drag n drop in general on that component.

The component has 2 events:

OnDragDrop and OnDragOver  ... does this help?

thx
Commented:
I just dowloader the source of TEmbeddedWB. Looking at the source of the component i see that it has the RegisterAsDropTarget property. This is a code snipet:

property Modified: Boolean read GetModified write SetModified;
    property DesignMode: Boolean read GetDesginMode write SetDesginMode;
  published
    property Silent: Boolean read GetSilent write SetSilent default True;
    property RegisterAsDropTarget: Boolean read GetRegisterAsDropTarget write SetRegisterAsDropTarget default True;    property RegisterAsBrowser: Boolean read GetRegisterAsBrowser write SetRegisterAsBrowser default False;
    property About: string read FAbout write SetAbout;
   

Are you sure you don't see this property in Delphi IDE ?

Author

Commented:
Im not using TEmbeddedWB. Im using: ProfDhtmlEdit component. Tried to get support but no luck, so I can only ask here :o/

Commented:
Hi, what you wan't cannot be done with this control as it is a custom component and has no drag/drop specific properties or events. I 've downloaded the online manual of the comp and looked it up. I don't know how this can be done as i don't have the source of the ProfDhtmlEdit comp. One other problem is that it heavily relies on IE, so maybe this is a function controled by IE and not by the comp it self...

Author

Commented:
Hi twinsoft...thanks for your time.

Yes, it seems to rely on IE BUT I have tried making changes to IE in registry and it doesn't work.

I've been trying to find some document online that can tell me what things can be modified on IE via registry or something but no luck yet :o/

Author

Commented:
thanks all for your time.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial