# Getting Started with FTR Controls

## Requirements

- Windows 10 or later
- Visual Studio 2019+ (recommended) or .NET SDK
- Target: **.NET Framework 4.7.2** or **net6.0-windows** (or compatible Windows WinForms TFM)

## Installation

### NuGet (recommended)

```powershell
Install-Package FTR.UI.WinForms
```

### Manual reference

1. Build or obtain **`FTR.UI.WinForms.dll`** for your target framework (`net472` or `net6.0-windows`).
2. Add a reference in your WinForms project.
3. Ensure **`FTR.UI.WinForms.xml`** sits next to the DLL for IntelliSense (included in NuGet `lib` folder).

## Referencing in code

```csharp
using FTRControls;                    // Most toolbox controls
using FTRDropDown;                    // FTRDropDown, DropDownItem
using FTRThemes.Themes;               // ThemeManager, IThemeableControl
using FTRControls.Theming;            // FTRThemeColors
using FTRControls.BaseClasses;        // FTRBaseControl, FTRBaseUserControl
using FTRControls.FTRGridView;        // FTRGridViewPro
using FTRControls.LicenseManager;     // LicenseService
```

## Toolbox

After installation, controls appear under **FTR Controls** in the Visual Studio Toolbox. Drag onto a form or create in code:

```csharp
var textBox = new FTRTextBox { Placeholder = "Search...", Dock = DockStyle.Top };
Controls.Add(textBox);
```

## Theme system

Set the global theme once (typically at application startup):

```csharp
using FTRThemes.Themes;

ThemeManager.CurrentTheme = ThemeManager.ThemeMode.Dark;
```

Available modes: `Light`, `Dark`, `Color`, `Duotone`.

Controls implementing `IThemeableControl` (and types derived from `FTRBaseControl` / `FTRBaseUserControl`) receive `ApplyTheme()` when the theme changes.

Use `FTRThemeColors` for consistent colors:

```csharp
using FTRControls.Theming;

panel.BackColor = FTRThemeColors.PanelBackColor;
```

## Licensing system

1. **Unlicensed** — controls work with default settings; premium properties are blocked.
2. **Activation** — user enters a vendor-supplied key in the activation dialog.
3. **Licensed** — `LicenseService.IsLicensed` returns true; premium APIs work.

Check before using premium APIs in your own code:

```csharp
using FTRControls.LicenseManager;

if (LicenseService.EnsureLicensed(this))
{
    // premium UI path
}
```

Or activate explicitly at startup:

```csharp
LicenseService.Activate(licenseKey);
```

See [LICENSE-GUIDE.md](../LICENSE-GUIDE.md) for customers.

## Free vs premium

- **Free:** core interaction, default styling, basic animations (e.g. toast fade), standard text and colors.
- **Premium:** properties in category **Premium Features**, `[PremiumFeature]`, or guarded setters that call `LicenseService.EnsureLicensed()`.

Each control's premium list: `Docs/controls/{ControlName}.md`.

## Toast notifications (quick example)

```csharp
ToastNotificationManager.Show("Saved successfully.", durationSeconds: 4, toast =>
{
    toast.Animation = FTRToastNotification.AnimationType.Fade; // premium: Slide*
});
```

## Message box (quick example)

```csharp
FTRMessageBox.Show("Continue?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
```

## Next steps

- [DOCUMENTATION.md](DOCUMENTATION.md) — architecture and FAQ
- [controls/](controls/) — per-control API and examples
- [index_en.html](index_en.html) — website-ready developer documentation
- IntelliSense — hover types in Visual Studio with XML documentation enabled
