# Disable a Segment

RadSegmentedControl allows you to disable each of its segments individually.

To disable a segment you can use the **SetSegmentEnabled** method. The method accepts two arguments **index** that determines the index of the segment. And **isEnabled** that determines whether the item is enabled or not.

You can also check if an item is enabled via the **IsSegmentEnabled** method. The method accepts a single argument - **index**.

## Setting Disabled Segment Text Color

You can set the text color of the disabled segment through the **DisabledForeground** property of the Segment.

#### **Example 1: Setting Disabled Foreground**

```XAML
<input:RadSegmentedControl x:Name="segmentControl" VerticalAlignment="Center" Margin="20">
	<input:RadSegmentedControl.ItemContainerStyle>
		<Style TargetType="input:Segment">
			<Setter Property="DisabledForeground" Value="Green"/>
		</Style>
	</input:RadSegmentedControl.ItemContainerStyle>
</input:RadSegmentedControl>
```

#### **Example 2: Disable Second Segment**

```C#
public Example()
{
	this.InitializeComponent();
	this.segmentControl.ItemsSource = new List<string>() { "Popular", "Library", "Playlists", "Friends" };
	this.segmentControl.SetSegmentEnabled(1, false);
}
```

#### Figure 1: Disabled segment

![WinUI SegmentedControl disable segment example](https://www.telerik.com/winui/documentation/assets/a934f5aca942b184a48ec5667d7aaf3d/segmentcontrol-disablesegment-0.png)

## See Also

* [Getting Started](https://www.telerik.com/winui/documentation/controls/radsegmentedcontrol/getting-started)
