InSelection Property

Applies To

Bound Object Frame Control, Chart Control, Check Box Control, Combo Box Control, Command Button Control, Label Control, Line Control, List Box Control, Option Button Control, Option Group Control, Page Break Control, Rectangle Control, Text Box Control, Toggle Button Control, Unbound Object Frame Control.

Description

You can use the InSelection property to determine or specify whether a control on a form in Design view is selected.

Setting

The InSelection property uses the following settings.


This property is available only in a macro or Visual Basic.

Remarks

When a control is selected, its sizing handles are visible and it can be resized by the user. More than one control can be selected at a time.

See Also

Control Object.

Example

The following example uses the InSelection property to determine whether the strControlName control on a form is selected.


Function IsControlSelected(frm As Form, strControlName As String) _
        As     Integer
    Dim intI As Integer, ctl As Control
    If frm.CurrentView <> 0 Then
        ' Form is not in Design view.
        Exit Function
    Else
        For intI = 0 To frm.Count-1
            Set ctl = frm(intI)
            If ctl.InSelection = True Then
                ' Is desired control selected?
                If UCase(ctl.Name) = UCase(strControlName) Then
                    IsControlSelected = True
                End If
            Else
                IsControlSelected = False
            End If
        Next intI
    End IfFunction