SelStart / SelLength like feature in DHTMLEdit / Webbrowser Control
How can I add a SelStart/SelLength like feature in DHTMLEdit/Webbrowser control ? Any idea ?
Re: SelStart / SelLength like feature in DHTMLEdit / Webbrowser Control
Re: SelStart / SelLength like feature in DHTMLEdit / Webbrowser Control
Thanks Mike.
I have never used textRange , and my JavaScript $ucks. Could you please post some VB/C++ code example ?
I'm making a WYSIWYG HTML editor for my iRead, so that it can read web pages too. (without loosing formatting and picture).
I need to use the SelStart/SelLength like features so that it can be integrated with my current RTB word highlighter code (and many other) without much hassle.
Re: SelStart / SelLength like feature in DHTMLEdit / Webbrowser Control
I have managed to create the textRange and able to get the text. But I don't understand how I get current textRange ? Also how to stepthrough each charecter in a textRange ?
VB Code:
'**********************************************************
Private m_SelStart As Long
Private m_SelLength As Long
'**********************************************************
Public Property Get Text() As String
On Error Resume Next
Dim txtrng As Object
Set txtrng = DHTMLEdit1.DOM.body.createTextRange
Text = txtrng.Text
End Property
Public Property Let Text(ByVal Value As String)
'How to detect active textRange ?
End Property
'**********************************************************
Public Property Get SelLength() As Long
'How to detect active textRange ?
End Property
Public Property Let SelLength(ByVal Value As Long)
'How to detect active textRange ?
End Property
'**********************************************************
Public Property Get SelStart() As Long
'How to detect active textRange ?
End Property
Public Property Let SelStart(ByVal Value As Long)
'How to detect active textRange ?
End Property
'**********************************************************
Re: SelStart / SelLength like feature in DHTMLEdit / Webbrowser Control
Your making a control?
I suggest working out the individual code in a normal exe so you can see it running.
Personally I still think the easiest way is to copy all text to a rich text box and then use selstart and sellength.
Mike
1 Attachment(s)
Re: SelStart / SelLength like feature in DHTMLEdit / Webbrowser Control
Yes. I'm making a control. I think that way it will be easier to merge with existing code.
The most inportant reasons I started writing iRead is,
- My current TTS software ($29.95 !!!) can't read formated document [rtf - Done, pdf - I have an idea, html - ?].
- That s/w doesn't save the position where it left off. [Done]
- Doesn't auto scrolls. [Done]
- Doesn't gray-out readen text [Done]
- Can't go to full screen mode. [Almost done. Thanks to Bushmobile.]
- Can't remember zoom setting. [Done]
- Doesn't integrate with browser. [I have done similar thing. Need to know more JS]
So, just copying text to RTB is not an option. It will loose all formatting and images. Currently it does similar.
I have attatched the control I'm making. It will be a very simple WYSIWYG HTML editor.