?
Solved

Webbrowser or DHTMLEdit Control ?

Posted on 2003-03-30
6
Medium Priority
?
234 Views
Last Modified: 2013-12-26
Hello ! I am designing a Webpage editor application.
I use therefore the webbrowser control with its designmode to on.
But there are many problems .The webbrowser control does not have source code preservation and does not act to events and many more.

I want to ask : i have been said to use the webbrowser control because microsoft does not support any more the Dhtmledit control and that it does have lots of bugs. Is it necessary that i should use the Webbrowser control ? Are really many bugs in the DHTMLEdit control ? and does this control not comply to new HTML standards ?


Thanks !

alexandros

0
Comment
Question by:alexr123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 5

Accepted Solution

by:
Rhaedes earned 80 total points
ID: 8244170
Hello again...
The link below is to Microsoft's own article on the DHTMLEdit. Click on the link 'What Ever Happened to the DHTML Edit Control?' (which, coming from Microsoft, kinda says it all!)

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmshtml/html/mshtmleditplatf.asp

Simply put, I can think of no good reason why you should use the old DHTMLEdit when you can use the Webbrowser. If you have come up against a problem (something you could do with the DHTMLEdit but not with the Webbrowser) it is probably simply because they do things slightly differently. Granted, some things are *slightly* easier to do with the DHTMLEdit, because it was designed for the job of editing, but there is, I beleive, nothing that cannot be reproduced in the webbrowser with 2 or 3 lines of code.

I wonder what others think?

Kindest regards,
Rhaedes
0
 
LVL 1

Author Comment

by:alexr123
ID: 8252045
Thank you again dear Rhaedes for replying.
The problem with the webbrowser control is that it does not support source code preservation.
And i am designing a webpage editor application that also has a code view .

i also have seen that you saw my post at
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20518797.html
please reply if you can.

the problem with the webbrowser control is moreover that you cannot easily trap events . for example i am designing a ruler and what to trap the mousemove event for the webbrowser control. while the dhtmledit has a mousemove event the webbrowser control does not.

regards,
alex


0
 
LVL 5

Expert Comment

by:Rhaedes
ID: 8255864
...Hi again. Let's see if we're on the same page. The Webbrowser has a few events associated with it, but mousemove is not one of them. HOWEVER, the HTML Document inside the Webbrowser IS very rich in events (has about 40), and DOES include a generic onmousemove.

1) Open a new exe project.
2) Add a REFERENCE to Microsoft HTML Object Library
3) In the Declarations section of your form add the following:
Private WithEvents Hdoc As HTMLDocument
4) Your project can now listen for events in the HTML document. Test this is the following way: At the top of your code window you have two drop-down menus. The one on the left should now contain the three items:
(General)
 Form
 Hdoc
Select Hdoc.
5) In the other drop-down, you have all the events associated with the HTML document, including onmousemove.
6) Of course, at this stage, the Hdoc isn't wired up to any document, so add a webbrowser control to the form., and make sure it loads a document (albeit a blank one) by add ing the code

Private Sub Form_Load()
WebBrowser1.Navigate2 ("about:blank")
End Sub

7) Finally, to hook up the document and the Object, add the code below:

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Set Hdoc = WebBrowser1.Document
End Sub

8) Now you're set. As I say, one of the document events is onmousemove, so you can use
 
Private Sub Hdoc_onmousemove()
'do stuff
End Sub


Hope this helps.
Kindest regards,
Rhaedes
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:alexr123
ID: 8259549
Thanks !
Just reply here
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20518797.html

and i will give you the 250 points.

i guess there is no way for source code preservation with the webbrowser control. i thought something that preserves
the code view and each time from the menu you insert html
you calculate what to insert manually.
for example
to insert an image you do not use the webbrowser DOM
but instead do something like this textbox.seltext="<img src="........"> "

the problem is to find where to insert this. i have found
a solution that is not that accurate but it seems to work.

best regards,
alex




0
 
LVL 5

Expert Comment

by:Rhaedes
ID: 8259930
Hi again.
Source code preservation: Surely what you really need is for the source code to be reformatted 'prettily' every time some thing is added. This is what FrontPage does. You could take a look at http://www.qbdsoftware.co.uk/moth/qweb/format.htm for how to do this.

Also, what about doing the following:
1) Store your source code in a variable
2) Let the user insert something in the WYSIWYG
3) Compare the new HTML with the original source code (say from the body tag, and find the point of divergence of the two strings.
4) Get the added HTML string
5) Insert the string into the original source code string at the point of divergence
6) Write the string back into the webbrowser.

It should work, but its tiresome to do.

Finally, with regard to the other question you posted: why don't you post a message at community support to delete the question and refund your points? It's really not fair to change questions half-way - not least because in a google search the results would be confusing.

Kindest regards,
Rhaedes
0
 
LVL 1

Author Comment

by:alexr123
ID: 8268302
ok i will i did not know i could do this

cheers,
alex
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question