# Selection.IsCommonValueSelected Method

> Informs about whether a certain attribute has the same value for the complete selection.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > Selection.IsCommonValueSelected Method
- **2019 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/selection/iscommonvalueselected-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/selection/iscommonvalueselected-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/selection/iscommonvalueselected-method/llms-full.txt

---

### Description

Informs about whether a certain attribute has the same value for the complete selection.

### Syntax

#### IsCommonValueSelected(Selection.Attribute)

Informs about whether an attribute from the [Selection.Attribute](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/selection/attribute-enumeration/llms-full.txt) enumeration has the same value for the complete selection.

```csharp
public bool IsCommonValueSelected(Selection.Attribute attribute);
```

```vbnet
Public Function IsCommonValueSelected(attribute As Selection.Attribute) As Boolean
```

| Parameter | Description |
|---|---|
| attribute | Specifies a possible value from the enumeration. |

#### IsCommonValueSelected(ParagraphFormat.Attribute)

Informs about whether an attribute from the [ParagraphFormat.Attribute](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/paragraphformat/attribute-enumeration/llms-full.txt) enumeration has the same value for the complete selection.

```csharp
public bool IsCommonValueSelected(ParagraphFormat.Attribute attribute);
```

```vbnet
Public Function IsCommonValueSelected(attribute As ParagraphFormat.Attribute) As Boolean
```

| Parameter | Description |
|---|---|
| attribute | Specifies a possible value from the enumeration. |

#### IsCommonValueSelected(ListFormat.Attribute)

Informs about whether an attribute from the [ListFormat.Attribute](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/listformat/attribute-enumeration/llms-full.txt) enumeration has the same value for the complete selection.

```csharp
public bool IsCommonValueSelected(ListFormat.Attribute attribute);
```

```vbnet
Public Function IsCommonValueSelected(attribute As ListFormat.Attribute) As Boolean
```

| Parameter | Description |
|---|---|
| attribute | Specifies a possible value from the enumeration. |

#### IsCommonValueSelected(SectionFormat.Attribute)

Informs about whether an attribute from the [SectionFormat.Attribute](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/sectionformat/attribute-enumeration/llms-full.txt) enumeration has the same value for the complete selection.

```csharp
public bool IsCommonValueSelected(SectionFormat.Attribute attribute);
```

```vbnet
Public Function IsCommonValueSelected(attribute As SectionFormat.Attribute) As Boolean
```

| Parameter | Description |
|---|---|
| attribute | Specifies a possible value from the enumeration. |

#### IsCommonValueSelected(PageMargins.Attribute)

Informs about whether an attribute from the [PageMargins.Attribute](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/pagemargins/attribute-enumeration/llms-full.txt) enumeration has the same value for the complete selection.

```csharp
public bool IsCommonValueSelected(PageMargins.Attribute attribute);
```

```vbnet
Public Function IsCommonValueSelected(attribute As PageMargins.Attribute) As Boolean
```

| Parameter | Description |
|---|---|
| attribute | Specifies a possible value from the enumeration. |

#### IsCommonValueSelected(PageSize.Attribute)

Informs about whether an attribute from the [PageSize.Attribute](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/pagesize/attribute-enumeration/llms-full.txt) enumeration has the same value for the complete selection.

```csharp
public bool IsCommonValueSelected(PageSize.Attribute attribute);
```

```vbnet
Public Function IsCommonValueSelected(attribute As PageSize.Attribute) As Boolean
```

| Parameter | Description |
|---|---|
| attribute | Specifies a possible value from the enumeration. |

#### IsCommonValueSelected(PageBorder.Attribute)

Informs about whether an attribute from the [PageBorder.Attribute](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/pageborder/attribute-enumeration/llms-full.txt) enumeration has the same value for the complete selection.

```csharp
public bool IsCommonValueSelected(PageBorder.Attribute attribute);
```

```vbnet
Public Function IsCommonValueSelected(attribute As PageBorder.Attribute) As Boolean
```

| Parameter | Description |
|---|---|
| attribute | Specifies a possible value from the enumeration. |

### Return Value

The return value is true if the complete selection is formatted with the same value of the specified attribute. Otherwise it is false.

### Examples

The following example formats the heading of a short document by using `Selection.IsCommonValueSelected`.

```csharp
textControl.Text = "Quarterly results\nRevenue increased by 12%.";
textControl.Select(0, 17);
Selection selection = textControl.Selection;

if (selection.IsCommonValueSelected(Selection.Attribute.Baseline))
{
    Console.WriteLine("Is Common Value Selected completed successfully.");
}
```

```vbnet
textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."
textControl.Select(0, 17)
Dim selection As Selection = textControl.Selection

If selection.IsCommonValueSelected(Selection.Attribute.Baseline) Then
    Console.WriteLine("Is Common Value Selected completed successfully.")
End If
```

---

## Nearby

- **Previous:** [Selection.IncreaseIndent Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/selection/increaseindent-method/llms-full.txt)
- **Next:** [Selection.Italic Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/selection/italic-property/llms-full.txt)
