Overview

BeepFinanceWidget is a paint-based WinForms widget that inherits from BaseControl. It uses an IWidgetPainter pipeline to render rich visuals without child controls. The Style property selects one of 10 built-in render modes; changing it at runtime immediately swaps the painter and triggers a repaint.

Toolbox icon: 💰
Category: Beep Widgets → Finance
Default size: 300 × 180
Namespace: TheTechIdea.Beep.Winform.Controls.Widgets

Key Features

💰 Ten Finance Styles

Portfolio to budget — every common fintech card pattern.

🎨 Positive/Negative Colors

Automatic green/red colouring driven by value sign.

💱 Currency Support

Currency symbol and code properties for localised display.

📊 Financial Chart

FinancialChart style renders candlestick or line overlays via GDI+.

📈 Budget Progress

BudgetWidget style shows horizontal bars for each budget category.

🔐 Masked Card

PaymentCard style renders masked card numbers (•••• •••• •••• 1234).

Style Variants (10)

Style ValueDescription
PortfolioCardInvestment portfolio with asset allocation and overall return.
CryptoWidgetCryptocurrency price and 24h change display.
TransactionCardFinancial transaction list with credit/debit indicators.
BalanceCardAccount balance with income and expense summary.
FinancialChartSpecialised financial candlestick or line chart.
PaymentCardPayment method card (masked card number, expiry).
InvestmentCardSingle investment holding with gain/loss indicator.
ExpenseCardExpense category breakdown with pie/progress sub-display.
RevenueCardRevenue tracking with period-over-period comparison.
BudgetWidgetBudget progress bars with spent vs allocated amounts.

Properties

PropertyTypeDefaultDescription
StyleFinanceWidgetStylePortfolioCardSelects the finance painter.
Titlestring"Finance Widget"Card heading.
Subtitlestring"Financial Data"Secondary heading or account name.
PrimaryValuedecimal0Main financial figure (balance, price, amount).
SecondaryValuedecimal0Supplementary figure (e.g. invested amount).
Percentagedecimal0Percentage change or allocation.
Currencystring"USD"ISO currency code.
CurrencySymbolstring"$"Symbol prepended to values.
PositiveColorColorColor(34,139,34)Colour for gains / positive values.
NegativeColorColorColor(220,20,60)Colour for losses / negative values.
NeutralColorColorColor(128,128,128)Colour for neutral/zero values.

Inherits all BaseControl properties (Border, Padding, Theme colors, etc.).

Events

EventArgs TypeDescription
ValueClickedBeepEventDataArgsFired when the primary value is clicked.
CardClickedBeepEventDataArgsFired when the card body is clicked.
ActionClickedBeepEventDataArgsFired when an action button (e.g. 'View Details') is clicked.

Basic Usage

var balance = new BeepFinanceWidget
{
    Style          = FinanceWidgetStyle.BalanceCard,
    Title          = "Checking Account",
    Subtitle       = "•••• 4521",
    PrimaryValue   = 12_450.75m,
    SecondaryValue = 3_200.00m,   // monthly income
    CurrencySymbol = "$",
    Size           = new Size(300, 160)
};

var budget = new BeepFinanceWidget
{
    Style        = FinanceWidgetStyle.BudgetWidget,
    Title        = "October Budget",
    PrimaryValue = 2400m,   // total budget
    Percentage   = 67m,     // percent used
    Size         = new Size(320, 200)
};

Event Handling

balance.CardClicked += (s, e) => OpenAccountDetails();
balance.ActionClicked += (s, e) => OpenTransferDialog();

Best Practices

  • Set Style before adding the widget to the form to avoid double repaints.
  • Adjust Size to fit your layout — defaults are minimum comfortable sizes.
  • Read BeepEventDataArgs.Data in event handlers for context-specific click data.
  • Call Invalidate() after updating data properties to trigger a repaint.
  • Let theme colors flow from BeepStyling.CurrentTheme — avoid overriding color properties unless customization is explicitly desired.