ViewStyle Property

Applies to TestComplete 15.45, last modified on December 01, 2022

Specifies the component’s style.

Declaration

componentPropObj.ViewStyle
Read-Write Property String
componentPropObj     One of the objects listed in the Applies To section  

Applies To

This property applies to the following objects:

TcxButtonEditProperties

Description

Use the ViewStyle property to specify the visual style of the TcxButtonEdit component.

Property Value

One of the following string values that specify the component’s behavior:

Value Description
vsNormal The component looks normal: it has an edit field for text entering and a number of buttons.
vsHideCursor The component has the edit field and buttons, but a user cannot type characters into the edit field. The component’s text can only be changed from scripts (for instance, from an event handler routine that processes a mouse click over a button).
vsButtonsOnly The component only displays buttons. It does not contain the edit field. The buttons’ widths are changed so that the buttons fill the component’s client area.
vsButtonsAutoWidth The component only displays buttons. It does not contain the edit field. The component’s width is changed according to the buttons’ widths.

Remarks

Setting the ViewStyle property to “vsHideCursor” hides the caret, so a user cannot change the component’s text in the edit field. The component’s text can only be changed from script code (for instance, it can be changed by an event handler that processes the button presses). This is similar to the situation when the ReadOnly property is True, but the difference is that in read-only mode the component does not hide the cursor thus giving a user the possibility to copy the component’s text to the clipboard.

Note that the ViewStyle and HideCursor properties depend on each other. HideCursor can only be True if ViewStyle is equal to “vsHideCursor”, “vsButtonsOnly” or “vsButtonsAutoWidth”. So, assigning “vsNormal” to ViewStyle changes the HideCursor property value to False. Setting ViewStyle to “vsHideCursor”, “vsButtonsOnly” or to “vsButtonsAutoWidth” automatically changes HideCursor to True. Similarly, if ViewStyle is equal to “vsNormal” and you assign True to HideCursor, ViewStyle will be changed to “vsHideCursor”.

See Also

HideCursor Property
ReadOnly Property
Stretchable Property

Highlight search results