I was wondering how I could have an HTML editor in my application. I want to make something like Front Page. How can I use ScriptLet in this case? ScriptLet just shows HTML files and it dosn't give any assist in editing htmls, like what happens in Front Page. Do you have any idea?
Your helping hands are appreciated
14-11-2002 at 08:34 AM
|
m_carryme Level: Guest
HTML Editor, How?
Please help even with your simplest ideas. Do you think the only control that can be used is a RichTextBox? Or are there more specified controls for editing HTML scripts.
14-11-2002 at 01:26 PM
|
vbgen Level: Moderator Registered: 10-10-2002 Posts: 876
Re: HTML Editor, How?
first, i have to ask... do you actually want to create a program that focuses on html editing?
why don't you put a webbrowser control on the form, and a textbox as well, though i think a richtextbox REALLY works too.
allow the webbrowser control to load the page, and when you want to view the html, then have it show the source onto the textbox... i'll try to search for code to let you do that.
please post back to the question i asked, and i'll try to help, and surely others will be able to give more help than i could alone. k?
____________________________
Been busy trying to take a second degree <--it's not working out...
14-11-2002 at 05:02 PM
|
m_carryme Level: Guest
Re: Re: HTML Editor, How?
Thank you for your response.
Actually, I want a "What You See Is What You Get" editor, just like what happens in FrontPage. That mean's to be able to see the result just at the same time you make any changes.
I thought of the idea you gave: to have 2 Tabs; one for HTML code, and another Tab for the webbrowser control to show the result of the HTML code in the previous Tab. But it isn't what I really want.
As far as I know webbrowser control can't be used for this purpose, because it doesn't let me have the insertion point, so the end user won't be able to make any changes in the web page if webbrowser control is used. Does it mean the only control that can be used is a RichTextBox?
Do you have any ideas on how to interprete what is shown in a RichTextBox as HTML code? I have this raw idea to check all the characters in the RichTextBox one by one, and if there's any changes (in the properties of the last character in comparison with the previous one), send the appropriate HTML tag to another string.
I'm sorry for this long reply, but here's the only place I hope to get some replies.
15-11-2002 at 03:55 AM
|
m_carryme Level: Guest
Re: HTML Editor, How?
I think I have found the answer. It might be "dHTML Edit" component. I'm not sure yet, because I don't have MSDN on my computer right now, but it lets you edit the contents in run time.
15-11-2002 at 01:46 PM
|
vbgen Level: Moderator Registered: 10-10-2002 Posts: 876
Re: HTML Editor, How?
okay... since i'm not so good with browsers, i'm just going to ask: "what do you mean by insertion point?"
also, can't you just refresh the browser when you go back to it after editing? just curious.
i'll see if there is a way to interpret richtxtbx contents.
pardon me for asking when it's actually you who needs help.
____________________________
Been busy trying to take a second degree <--it's not working out...
15-11-2002 at 04:35 PM
|
m_carryme Level: Guest
Re: Re: HTML Editor, How?
Insertion point has nothing to do with browsers. As you can find from it's name, it's where you can insert text, image, or anything else in an editable text, i.e. TextBox. I mean that vertical line that blinks. You may call it cursor.
And about the editor. I told you before. I want a "WYSIWYG" editor. That means "What You See Is What You Get". Just like Front Page. You edit the final draft of your web page. You don't need to edit any HTML code or tags. There's only a visual interface. No HTML codes.
16-11-2002 at 04:21 AM
|
vbgen Level: Moderator Registered: 10-10-2002 Posts: 876
Re: HTML Editor, How?
okay, i gotcha.
i'll look into dhtml, and how vb can work along with it. i'll post back as soon as i get info.
____________________________
Been busy trying to take a second degree <--it's not working out...
16-11-2002 at 05:57 PM
|
stickleprojects Level: Moderator Registered: 09-09-2002 Posts: 891
Re: HTML Editor, How?
Hi,
I dont know if it's important, but I heard that the WebBrowser control can be used to display text rather than a file. use navigate2 "about://<html>mytexthere</HTML>" method.
MSHTML/DHTML would allow you to create the elements on keypress of the control, but if you don't wish the users to worry about the HTML codes, how will they select images and the like.
Does that then become the same as a RichTextBox?
K
____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)
23-11-2002 at 09:47 AM
|
synergy Level: Guest
Re: HTML Editor, How?
First add a reference to M$ HTML Object Library. Then:
Dim htmDoc As HTMLDocument
Private Sub Form_Load()
WebBrowser1.Navigate "about:blank"
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Set htmDoc = WebBrowser1.Document
htmDoc.designMode = "On"
End Sub
The webBrowser control will be editable and have the caret blinking when you start. You can write, copy-paste, dragdrop, etc.
16-12-2002 at 08:10 AM
|
vbgen Level: Moderator Registered: 10-10-2002 Posts: 876
Re: HTML Editor, How?
well, since synergy had brought up this topic again, i can give you help on a WYSIWYG interface just like frontpage.
just post back and i'll help you out. k?
____________________________
Been busy trying to take a second degree <--it's not working out...
16-12-2002 at 03:04 PM
|
njsg Level: Guest
Re: HTML Editor, How?
quote:stickleprojects wrote:
Hi,
I dont know if it's important, but I heard that the WebBrowser control can be used to display text rather than a file. use navigate2 "about://<html>mytexthere</HTML>" method.
(...)
Yes. Try to create a textbox to edit HTML code, and add a webbrowser control in the form when is the textbox. Create a button and add the following code (to the form where are placed the controls):
Private Sub Command1_Click()
webbrowser1.navigate "about:" & text1.text
End Sub
Is good to page previews without savings - but the files related with the page (images, etc.) with a relative link will not be previewed!