SpiceLogic Inc.
                                                                                                     SpiceLogic Inc. Home PageProductsJournalMy AccountHelp DeskContact Us
 
Knowledge base  : .NET Win HTML Editor Control    - Standard Edition
Welcome Guest   Login

Skip Navigation Links. .NET Win HTML Editor Control

Documentation  Documentation

Download   Download the latest version

Back to the home of knowledgebase forum Set Caret Position

An user   4/24/2010 8:34:06 PM

You showed me how to get the caret position as a point and an integer. And also how to set the position as a point or integer. But I am not clear yet on how to set the caret position based on specific text in the editor. Is this possible? I am not sure how to get point position of specific text, or the x y coordinates of the text. I only know how to get the start index of the text, which is not where the caret is currently, or how to move the caret to that start index.


An user   4/25/2010 10:53:44 AM

Maybe if I explain more, you can point me to the best method.  A user might have a predefined template that gets loaded into the editor. Their template might look like this:
 
-----
Dear customer,
 
[[CURSOR]]
 
Regards,
Support
-------
 
So I would like to be able to remove the text "[[CURSOR]]" and set the caret at that position after the text is removed. How would I best achieve this?



Resolution:
- [SpiceLogic Support Technician]   4/25/2010 11:07:50 PM

I see, yes, you can easily do that by using the following snippet:
 

        htmlEditor1.Search("[[CURSOR]]", True, True, True)

        HtmlEditor1.Operations.Delete()

        HtmlEditor1.Focus()




Home  || Products  || Journal  || My Account  || HelpDesk  || Contact Us

Website and Software Copyright ©2010, SpiceLogic Inc., All Rights Reserved.