> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XFrontPanelSetLightStates

> XFrontPanelSetLightStates

# XFrontPanelSetLightStates

設定前面板指示燈的狀態。

## 語法

```cpp theme={null}
HRESULT XFrontPanelSetLightStates(  
         XFrontPanelLight lights  
)  
```

### 參數

*lights*   \_In\_\
類型：[XFrontPanelLight](https://docs.xbox.com/zh-TW/reference/devkit/xfrontpaneldisplay/enums/xfrontpanellight.md)

指定前面板指示燈新狀態的值。

### 傳回值

類型：HRESULT

如果成功，會傳回 `S_OK`；否則會傳回錯誤碼。

## 備註

XBOX One X 開發套件的前面板包含五個指示燈，分別對應五個可程式化按鈕。

![XBOX One X 的前面板顯示器](https://mintcdn.com/microsoft-4404708b/-_0FrcE2bDxzGxv-/images/gdk/reference/front_panel_display_small.png?fit=max\&auto=format\&n=-_0FrcE2bDxzGxv-\&q=85\&s=8c81bf256714cec6526e83a4cbac5538)

針對 *lights* 參數，請使用位元 OR 運算子來組合 [XFrontPanelLight](https://docs.xbox.com/zh-TW/reference/devkit/xfrontpaneldisplay/enums/xfrontpanellight.md) 列舉中的值。

若要取得前面板指示燈目前的狀態，請使用 [XFrontPanelGetLightStates](https://docs.xbox.com/zh-TW/reference/devkit/xfrontpaneldisplay/functions/xfrontpanelgetlightstates.md)。

如需詳細資訊，請參閱 [XBOX One X：使用前面板顯示器 (NDA 主題)](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/dev-kits/concepts/scorpio-frontpanel)。

## 需求

**標頭：** xfrontpaneldisplay.h

**程式庫：** xfrontpaneldisplay.lib

**支援的平台：** XBOX One 系列主機和 XBOX Series 主機

## 另請參閱

[XFrontPanelDisplay](https://docs.xbox.com/zh-TW/reference/devkit/xfrontpaneldisplay/xfrontpaneldisplay_members.md)


## Related topics

- [XFrontPanelLight](https://docs.xbox.com/zh-TW/reference/devkit/xfrontpaneldisplay/enums/xfrontpanellight.md)
- [XFrontPanelGetLightStates](https://docs.xbox.com/zh-TW/reference/devkit/xfrontpaneldisplay/functions/xfrontpanelgetlightstates.md)
- [XFrontPanelDisplay (API 內容)](https://docs.xbox.com/zh-TW/reference/devkit/xfrontpaneldisplay/xfrontpaneldisplay_members.md)
- [XFrontPanelGetButtonStates](https://docs.xbox.com/zh-TW/reference/devkit/xfrontpaneldisplay/functions/xfrontpanelgetbuttonstates.md)
- [XFrontPanelButton](https://docs.xbox.com/zh-TW/reference/devkit/xfrontpaneldisplay/enums/xfrontpanelbutton.md)
