Basic Examples
Simple examples to get started with common Beep Controls
Simple Login Form
Using BeepiFormPro as the host form and BaseControl-based controls:
Login form with BeepiFormPro
using TheTechIdea.Beep.Winform.Controls;
using TheTechIdea.Beep.Winform.Controls.Forms.ModernForm;
public class LoginForm : BeepiFormPro
{
public LoginForm()
{
Text = "Sign In";
Size = new Size(420, 380);
FormStyle = FormStyle.Material;
var loginPanel = new BeepPanel();
loginPanel.Size = new Size(350, 260);
loginPanel.Location = new Point(30, 60);
loginPanel.PainterKind = BaseControlPainterKind.Card; // Card with shadow
var title = new BeepLabel();
title.Text = "Sign In";
title.Location = new Point(20, 15);
var username = new BeepTextBox();
username.Size = new Size(300, 35);
username.Location = new Point(20, 55);
var password = new BeepTextBox();
password.IsPassword = true;
password.Size = new Size(300, 35);
password.Location = new Point(20, 100);
var remember = new BeepCheckBox();
remember.Text = "Remember me";
remember.Location = new Point(20, 150);
var loginBtn = new BeepButton();
loginBtn.Text = "Login";
loginBtn.Size = new Size(300, 40);
loginBtn.Location = new Point(20, 190);
loginBtn.ImagePath = "icons/login.svg";
loginBtn.Click += (s, e) => { /* handle login */ };
loginPanel.Controls.AddRange(new Control[] {
title, username, password, remember, loginBtn
});
Controls.Add(loginPanel);
}
}
Controls with Different Painter Kinds
Every BaseControl descendant supports PainterKind for different visual strategies:
BaseControlPainterKind examples
// Card-style panel
var cardPanel = new BeepPanel();
cardPanel.PainterKind = BaseControlPainterKind.Card;
cardPanel.Size = new Size(300, 200);
// Glassmorphism button (frosted glass effect)
var glassBtn = new BeepButton();
glassBtn.PainterKind = BaseControlPainterKind.Glassmorphism;
glassBtn.Text = "Glass Button";
glassBtn.Size = new Size(160, 45);
// Neumorphism panel (soft 3D embossed)
var neoPanel = new BeepPanel();
neoPanel.PainterKind = BaseControlPainterKind.Neumorphism;
neoPanel.Size = new Size(250, 150);
// NeoBrutalist button (bold outlines, offset shadows)
var bruteBtn = new BeepButton();
bruteBtn.PainterKind = BaseControlPainterKind.NeoBrutalist;
bruteBtn.Text = "Bold!";
bruteBtn.Size = new Size(140, 45);
Data Grid with Navigation
BeepSimpleGrid with BeepDataNavigator
var grid = new BeepSimpleGrid();
grid.Size = new Size(600, 300);
grid.Location = new Point(20, 20);
grid.DataSource = GetProducts(); // Your data method
var navigator = new BeepDataNavigator();
navigator.Size = new Size(600, 40);
navigator.Location = new Point(20, 330);
navigator.Grid = grid;
Tab Control with Panels
BeepTabControl usage
var tabs = new BeepTabControl();
tabs.Size = new Size(500, 350);
tabs.Location = new Point(20, 20);
// Add tabs
tabs.AddTab("General", generalPanel);
tabs.AddTab("Settings", settingsPanel);
tabs.AddTab("About", aboutPanel);
// Switch to a specific tab
tabs.SelectedIndex = 0;
Progress Indicator
BeepProgressBar with async update
var progress = new BeepProgressBar();
progress.Size = new Size(400, 25);
progress.Location = new Point(20, 20);
progress.Value = 0;
progress.Maximum = 100;
// Update progress during an operation
for (int i = 0; i <= 100; i++)
{
progress.Value = i;
await Task.Delay(50);
}
Star Rating
BeepStarRating control
var rating = new BeepStarRating();
rating.Size = new Size(200, 40);
rating.Location = new Point(20, 20);
rating.MaxRating = 5;
rating.Rating = 3;
rating.RatingChanged += (s, e) =>
{
Console.WriteLine($"New rating: {rating.Rating}");
};