Inardesige
10-03-2001, 07:53 AM
i am trying to make my first html editor, but i want to make it somewhat like frontpage, where when a certain tab is clicked, it will show them a preview of what the document will look like when viewed, any advice?
“To achieve great things we must live as though we were never going to die.” Marquis De Vauvenargues
PWNettle
10-03-2001, 07:57 AM
There may be a slicker way to do it, but I've done HTML previewing before by having my program write a temporary HTML file then opening this temp file into a web browser control in my application. I delete the temp file (if it exists) when the application exits. I can provide an example of this if needed.
Paul
Inardesige
10-03-2001, 08:01 AM
that is what i thought that i would have to do, all i wanted was some confirmation, but if someone has some easier way to do it, then i would greatly appreciate it.
“To achieve great things we must live as though we were never going to die.” Marquis De Vauvenargues
Inardesige
10-03-2001, 08:03 AM
what would i use to make it so that i could somewhat see what i am putting in there, the same way that frontpage has it, where you can drag and drop items where you want them?
“To achieve great things we must live as though we were never going to die.” Marquis De Vauvenargues
when you click your tab load your html into a webbrowser and display it, add the DHTMLEdit component to your project for an easy wysiwyg htmleditor.
I have an HTMLEditor where I use a richtextbox for HTML code, a DHTMLEdit for wysiwyg and a webbrowser control to view it, I just set the zorder to change view and transfer the HTML from one to the other with the following code
<pre><font color=green>'wysiwyg to HTML</font color=green>
DHTMLBox.DocumentHTML = txtHTML.Text
DHTMLBox.zorder
<font color=green>'html to wysiwyg</font color=green>
txtHTML.Text = DHTMLBox.DocumentHTML
txtHTML.zorder
<font color=green>'wysiwyg to browser</font color=green>
Browser.Document.open
Browser.Document.write DHTMLBox.DocumentHTML
Browser.Document.Close
txtHTML.Text = DHTMLBox.DocumentHTML
Browser.zorder
<font color=green>'HTML to browser</font color=green>
Browser.Document.open
Browser.Document.write txtHTML.Text
Browser.Document.Close
DHTMLBox.DocumentHTML = txtHTML.Text
Browser.zorder</pre>
Inardesige
10-03-2001, 08:17 AM
do you know how i would get a 3d border around my webbrowser control?
“To achieve great things we must live as though we were never going to die.” Marquis De Vauvenargues
you will find it gets one as soon as it has loaded a page
try sticking this in you form load
<pre>WebBrowser1.Navigate2 "about:blank"</pre>
Inardesige
10-10-2001, 06:00 AM
how would you suggest that i put these in there so that it updates when it is supposed to?
'wysiwyg to HTML
DHTMLBox.DocumentHTML = txtHTML.Text
DHTMLBox.zorder
'html to wysiwyg
txtHTML.Text = DHTMLBox.DocumentHTML
txtHTML.zorder
'wysiwyg to browser
Browser.Document.open
Browser.Document.write DHTMLBox.DocumentHTML
Browser.Document.Close
txtHTML.Text = DHTMLBox.DocumentHTML
Browser.zorder
'HTML to browser
Browser.Document.open
Browser.Document.write txtHTML.Text
Browser.Document.Close
DHTMLBox.DocumentHTML = txtHTML.Text
Browser.zorder
I just sized all three components the same size and layed them on top of each other and then put the code into some graphical style option buttons, but you could use tabs or whatever you like the look of