فیلترشکن فعاله فیلترشکن فعاله

عید نوروز مبارک

using System
using System.Collections.Generic
using System.Drawing
using System.Windows.Forms

namespace AccountingApp
{
public partial class MainForm : Form
{
private ListTransaction transactions = new ListTransaction()

public MainForm()
{
InitializeComponent()
// پس‌زمینه RGB
this.BackColor = Color.FromArgb(30, 30, 60) // رنگ زمینه آبی تیره RGB
this.ForeColor = Color.White
InitializeCustomComponents()
}

private void InitializeCustomComponents()
{
// عنوان برنامه
Label titleLabel = new Label
{
Text = برنامه حسابداری,
Font = new Font(Tahoma, 16, FontStyle.Bold),
ForeColor = Color.LightBlue,
AutoSize = true,
Location = new Point(150, 20)
}
this.Controls.Add(titleLabel)

// توضیح تراکنش
Label descLabel = new Label
{
Text = توضیح:,
Location = new Point(20, 70),
ForeColor = Color.White
}
this.Controls.Add(descLabel)

TextBox descTextBox = new TextBox
{
Name = descTextBox,
Location = new Point(100, 70),
Width = 200
}
this.Controls.Add(descTextBox)

// مقدار تراکنش
Label amountLabel = new Label
{
Text = مقدار:,
Location = new Point(20, 110),
ForeColor = Color.White
}
this.Controls.Add(amountLabel)

TextBox amountTextBox = new TextBox
{
Name = amountTextBox,
Location = new Point(100, 110),
Width = 200
}
this.Controls.Add(amountTextBox)

// دکمه افزودن تراکنش
Button addButton = new Button
{
Text = افزودن تراکنش,
Location = new Point(100, 150),
BackColor = Color.FromArgb(50, 150, 50),
ForeColor = Color.White
}
addButton.Click += (sender, e) =
{
string deion = descTextBox.Text
if (double.TryParse(amountTextBox.Text, out double amount))
{
transactions.Add(new Transaction { Deion = deion, Amount = amount })
UpdateTransactionList()
descTextBox.Clear()
amountTextBox.Clear()
}
else
{
MessageBox.Show(لطفاً مقدار معتبر وارد کنید.)
}
}
this.Controls.Add(addButton)

// لیست تراکنش‌ها
ListBox transactionListBox = new ListBox
{
Name = transactionListBox,
Location = new Point(20, 200),
Width = 350,
Height = 150,
BackColor = Color.FromArgb(40, 40, 70),
ForeColor = Color.White
}
this.Controls.Add(transactionListBox)

// موجودی کل
Label balanceLabel = new Label
{
Name = balanceLabel,
Text = موجودی کل: 0,
Location = new Point(20, 370),
ForeColor = Color.Yellow,
AutoSize = true
}
this.Controls.Add(balanceLabel)
}

private void UpdateTransactionList()
{
ListBox transactionListBox = (ListBox)this.Controls[transactionListBox]
Label balanceLabel = (Label)this.Controls[balanceLabel]

transactionListBox.Items.Clear()
double balance = 0
foreach (var t in transactions)
{
transactionListBox.Items.Add(${t.Deion} : {t.Amount})
balance += t.Amount
}

balanceLabel.Text = $موجودی کل: {balance}
}
}

public class Transaction
{
public string Deion { get set }
public double Amount { get set }
}
}
  • 🙈
  • 🙉
  • 🙊
  • 💛
  • 💔
  • 💯
  • 💢
  • 👍
  • 👎
  • 👏
  • 👈
  • 👉
  • 🙏
  • 💪
  • 🎬
  • 🐥
  • 🌹
  • 🍁
  • 🍉
  • 🍕
  • 🍳
  • 🎂
  • 🎈
  • 🌍
  • 💩
  • 🚗
  • 📙
  • 😀
  • 😂
  • 😉
  • 😊
  • 😍
  • 😘
  • 💋
  • 😋
  • 😜
  • 👀
  • 😐
  • 😕
  • 😎
  • 😌
  • 😒
  • 😬
  • 😔
  • 😢
  • 😭
  • 😷
  • 😎
  • 😨
  • 😱
  • 😡
  • 😠
😊

X
این ویدیو

×