Chodzi mi o to, że jeżeli wpiszę liczbę np.10 to po zamknięciu programu i ponownym otwarciu w textbox'ie dalej będzie 10.
Da się tak zrobić?
Mój kod:
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace A
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
int screen;
double a;
double b;
double c;
double result = 0;
private void Dodawanie_Click(object sender, RoutedEventArgs e)
{
b = double.Parse(TXB_2.Text);
result += b;
TXB_1.Text = (result.ToString());
TXB_2.Text = "";
}
private void Odejmowanie_Click(object sender, RoutedEventArgs e)
{
b = double.Parse(TXB_2.Text);
result -= b;
TXB_1.Text = (result.ToString());
TXB_2.Text = "";
}
private void Usuwanie_Click(object sender, RoutedEventArgs e)
{
TXB_1.Text = "";
}
private void B_1_Click(object sender, RoutedEventArgs e)
{
TXB_2.Text = TXB_2.Text + "1";
}
private void B_2_Click(object sender, RoutedEventArgs e)
{
TXB_2.Text = TXB_2.Text + "2";
}
private void B3_Click(object sender, RoutedEventArgs e)
{
TXB_2.Text = TXB_2.Text + "3";
}
private void B4_Click(object sender, RoutedEventArgs e)
{
TXB_2.Text = TXB_2.Text + "4";
}
private void B5_Click(object sender, RoutedEventArgs e)
{
TXB_2.Text = TXB_2.Text + "5";
}
private void B6_Click(object sender, RoutedEventArgs e)
{
TXB_2.Text = TXB_2.Text + "6";
}
private void B7_Click(object sender, RoutedEventArgs e)
{
TXB_2.Text = TXB_2.Text + "7";
}
private void B8_Click(object sender, RoutedEventArgs e)
{
TXB_2.Text = TXB_2.Text + "8";
}
private void B9_Click(object sender, RoutedEventArgs e)
{
TXB_2.Text = TXB_2.Text + "9";
}
private void B0_Click(object sender, RoutedEventArgs e)
{
TXB_2.Text = TXB_2.Text + "0";
}
}
}
using System;
<image>foo</image>
- d27b62dba6.png (145 KB) - ściągnięć: 139