Programming Delphi TWebBrowser has been set to design mode, but the element can not be edited by drag and drop
Notice: Undefined variable: relatedArticlesCount in /home/wwwroot/codeback.net/plugins/content/tags.php on line 149

I am writing a simple web editor like dreamweaver, I used the TWebBrowser as the editing component. When I run the program, the webbrowser component's design mode has already been set to on, and I can also edit the html elements in my webbrowser window now.

While one problem I found was that I could not move the element by drag and drop. When I select an element in the window and then hold the left mouse button down, then try to move the element to another place by drag the frag of this element, but fail. I found the mouse cursor changed as a crNo shap.

Since I used to use this function in Delphi, I check my codes carefully and found nothing wrong. Late I found out a program I wrote before, and make comparation between these two progrmas many times. Finally I found, I forget to call the OleInitialize function which I remember I already wrote in the form create event.

So, to add these 2 functions, I make my program works on drag and drop editing mode.
OleInitialize(nil);
OleUninitialize;

You could also see carefully specification to these 2 functions in article TCppWebBrowser/TWebBrowser has been set to the edit mode, but the copy and paste do not work .


Add comment


Security code
Refresh

Programming - Delphi