Moving carets

Joined
Jul 2, 2003
Messages
17
Location
Ouston, Newcastle Upon Tyne, England
hi first time writting tread here pretty new to dotnet any way i was wondering a if any of you can can help me i writting and html/xml code editor, along with other things, which can let me put closing and ending tags by using keyboard short cuts and i got it all figured out and working but i would like to move the caret automatically in between the end of one tag and the start of of another for instance i want the caret bar where the "X" is in this exmaple <html>X</html>

if possible in vb.net or c++.net

if anyone can help it would be much appreciated

secondly is C# worth learning?


cheers
ps. i apologise for any bad spelling:)
 
Code:
    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        If InStr(TextBox1.Text, "<html>") Then
            Dim iPos As Integer = InStr(TextBox1.Text, "<html>", CompareMethod.Text)
            TextBox1.SelectionStart = iPos + 5
            TextBox1.SelectedText = ("some text after the <html> tag!")
            TextBox1.SelectionStart = Len(TextBox1.Text)
        End If
    End Sub
you can use TextBox1.ScrollToCaret() , but SelectionStart is better in that case :)
 
Thats not quite what i meant i should have explained better the function i wrote adds both <html> and </html> to the text of thr text box i would like know how to automatic position the caret in between the <html> tag and the </html> tag

but cheers anyway dude
 
Back
Top