Home Forums General XMetaL Discussion Move cursor inside node from selection Reply To: Move cursor inside node from selection

Derek Read

Reply to: Move cursor inside node from selection

There would be quite a few ways to do this. Here are a couple of the simplest. You might need additional code if your selection is not always guaranteed to be as you have described it.

Assuming you meant “directly after the tag” (not “element”, which would put it after the tag) this should do it:
Selection.Collapse(sqCollapseStart);
Selection.MoveRight();

This would result in the same selection:
Selection.Collapse(sqCollapseStart);
Selection.MoveToElement("car");

As would this:
Selection.Collapse(sqCollapseStart);
Selection.MoveToElement("");

And so would this:
Selection.MoveToDocumentStart();
Selection.MoveToElement("car");

Reply

Products
Downloads
Support