PromptPlus

PromptPlus # PromptPlus ## **Confirm — Styles** [![NuGet](https://img.shields.io/badge/NuGet-PromptPlus-blue)](https://www.nuget.org/packages/PromptPlus) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![.NET](https://img.shields.io/badge/.NET-8%20%7C%209%20%7C%2010-512BD4)](https://dotnet.microsoft.com/)

← Back to HomeNext: Input Control →


Confirm paints its output through the same KeyPressStyles regions as KeyPress, because it is a KeyPress control. The full region list and recoloring guidance live on the KeyPress → Styles page; this page is a short pointer.

ℹ️ Styling is per control — there is no global “style all Confirm” API. The only style-related global setting is PromptPlus.Config.ContrastRatio.


The KeyPressStyles regions

Region What it paints
Prompt The prompt text
Answer The pressed-key answer line
Description The description line under the prompt
Tooltips The Yes/No key-hint line
Error The invalid-key message line

Recoloring a region

Use the fluent Styles method exactly as on KeyPress. A Style is a foreground color and a background color — there is no bold/italic/underline. A bare Color is accepted as shorthand for a foreground-only style.

using ConsolePlusLibrary;
using PromptPlusLibrary;

PromptPlus.Controls
    .Confirm("Apply changes?")
    .Styles(KeyPressStyles.Prompt, Color.Yellow)                       // Color shorthand
    .Styles(KeyPressStyles.Error, new Style(Color.Red, Color.Default)) // explicit fg + bg
    .Run();

See also