XamSyntaxEditor("xamSyntaxEditor1"). BackspaceXCharacters 5
This topic provides information about the xamSyntaxEditor™ control’s testable user recordable methods.
This topic contains the following sections:
The following table lists the code examples included in this topic.
Allows you to update the text in xamSyntaxEditor view by pressing the Backspace
key any number of times erases individual characters and moves the caret one character at a time towards the beginning of the string. If you have some selected text, the backspace operation will erase the text at once and record as BackspaceXCharacter 1
, for each strike of the key.
The following table briefly explains the recordable methods for testing the control. Detailed information about the methods follows the table.
The backspace operation will queue to record if at any time, since the last recorded action, the amount of characters is less than what started with no additions. It will record after a few seconds since your last keystroke, or if you trigger a different action.
Selecting a text or a series of texts, then pressing the Backspace
key and typing some text
Pressing the Backspace key any number of times without typing
Preforming text-cutting operation of the selected text
Recording does not occur when you select 10 characters, and type a single character. However, it will record it as a SendString action even if the total characters are less than the selected characters.
Typing a series of keystrokes, then pressing the Backspace
key erases some of the characters, but not more than what you added. This only records the SendString action for the characters last added.
Demonstrates how to delete five characters back from the current caret position using the keyboard’s Backspace
key.
XamSyntaxEditor("xamSyntaxEditor1"). BackspaceXCharacters 5
There is no document currently loaded in the xamSyntaxEditor; required to perform this operation.
Allows updating the text in xamSyntaxEditor view by pressing the Delete
key any number of times erasing the currently selected text and advancing the caret location migration to the right of the cursor.
The following table briefly explains about the recordable methods for testing the control. Detailed information about the methods follows the table.
The delete operation will queue to record if, at any time since the last recorded action, the amount of characters are less than what you started with, and no additions. The recording will commence after a few seconds since your last keystroke, or if you trigger a different action.
Selecting a text or a series of texts, then pressing the Delete
key and typing some text
Pressing the Delete
key any number of times without typing
It will not record when you select 10 characters, and type a single character. It will record it as SendString action even though the total characters are less than the selected characters.
Demonstrates how to delete five characters from the current caret position using the keyboard’s Delete key.
XamSyntaxEditor("xamSyntaxEditor1").DeleteXCharacters 5
There is no document currently loaded in the xamSyntaxEditor; required to perform this operation.
The ExecuteCommand replay action featured in 13.1 release for xamSyntaxEditor now provides not only Cut, Copy and Paste operations, but also allows you to use any of the Infragistics ( SyntaxEditorCommandType ) commands via the Test Automation ( syedCommandType ) enumeration.
The following table explains the method’s parameter followed by code example.
To copy the selected text to the clipboard.
XamSyntaxEditor("Identifier").ExecuteCommand syedCopy
To cut the selected text to the clipboard.
XamSyntaxEditor("Identifier").ExecuteCommand syedCut
To paste the text from the clipboard.
XamSyntaxEditor("Identifier").ExecuteCommand syedPaste
The reason an exception returns from this action is that the supplied option is an invalid option; the only valid option is [{0}].
Allows manipulating the text editor’s cursor location and selection.
The following table explains the method’s parameters followed by code example.
Selects text, starting from the current caret position and extending to the location of the caret to line number 3, and between the first and second characters, as specified in the code.
XamSyntaxEditor("xamSyntaxEditor1").SelectToLocation Array(2, 1)
Selecting from the current caret position to between the 25th and 26th overall characters.
XamSyntaxEditor("xamSyntaxEditor1").SelectToLocation 25
There is no document currently loaded in the xamSyntaxEditor; required to perform this operation.
Another possibility is that the TextLocation argument [{0}] is malformed the correct format should be
:\``n iOffsetLocation | ARRAY(iLineIndex, iCharIndex).
Allows typing or pasting in a series of characters in the xamSyntaxEditor view.
The following table explains the method’s parameters followed by code example.
This example shows how to send a string “ Hello ” to the current caret position.
XamSyntaxEditor("xamSyntaxEditor1").SendString “Hello”
This example shows how to send a string “ Hi ,” to the tab followed by a return, with “ Bob ” on the following line.
XamSyntaxEditor("xamSyntaxEditor1").SendString vbTab + “Hi,” + vbCRLF + “Bob”
Sending the supplied text fails because it contained a tab that the xamSyntaxEditor does not accept. There is no document currently loaded in the xamSyntaxEditor; required to perform this operation.
Sets the active view of the xamSyntaxEditor by clicking on the area outside of the text area.
The following table explains the method’s parameters followed by code example.
The following example demonstrates how to change the active view to upper or left view location.
XamSyntaxEditor("xamSyntaxEditor1").SetActiveView syedUpperOrLeft
You have not split the xamSyntaxEditor view, a requirement for setting the specified view.
Allows manipulating the cursor location and selection on the xamSyntaxEditor view.
The following table explains the method’s parameters followed by code example.
The following example demonstrates an action for setting the location of the caret to line number 3, indicating the first argument of the Array (zero-based), and between the first and second characters, indicating the second argument of the Array.
XamSyntaxEditor("xamSyntaxEditor1").SetCaretLocation Array(2, 1)
This example demonstrates an action for setting the location of the caret to be between the 25th and 26th overall characters.
XamSyntaxEditor("xamSyntaxEditor1").SetCaretLocation 25
There is no document currently loaded in the xamSyntaxEditor; required to perform this operation. Another possibility is that the TextLocation argument [{0}] is malformed, format should be
:\``n iOffsetLocation | ARRAY(iLineIndex, iCharIndex)
.
Allows manipulating the text editor’s environment such as adding or removing a splitter, used to divide the view vertically or horizontally. Use this method to create duplicate views with the same text content in both views.
The following table explains the method’s parameters followed by code example.
Setting the splitter orientation to vertical in a position of 314 pixels.
XamSyntaxEditor("xamSyntaxEditor1").SetSplitter igVertical, 314
Setting the splitter orientation to horizontal in a position of 25 pixels.
XamSyntaxEditor("xamSyntaxEditor1").SetSplitter igHorizontal, 25
Cannot set the Vertical splitter orientation, whenever the Horizontal splitter is visible.
Attempting to set a vertical position while in the horizontal mode will cause an exception. The same is true when attempting to set horizontal position while the mode is vertical.
Allows for updating text in the xamSyntaxEditor view, permitting modifications to the text.
The following table explains the method’s parameters followed by code example.
The following example demonstrates how to change the current update mode from Insert to Overwrite.
XamSyntaxEditor("xamSyntaxEditor1").SetUpdateMode igOverwrite
The following list contains the possible exception for the method and the reason that is likely to be causing them.
There is no document currently loaded in the xamSyntaxEditor; required to perform this operation loaded
Editing is disabled
The following topics provide additional information related to this topic.