Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // FORM 1
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using static System.Windows.Forms.VisualStyles.VisualStyleElement;
- namespace test2
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- }
- private void button1_Click(object sender, EventArgs e)
- {
- textBox1.Text = ("New User");
- }
- private void textBox2_TextChanged(object sender, EventArgs e)
- {
- }
- private void button2_Click(object sender, EventArgs e)
- {
- listBox1.Items.Add(textBox1.Text);
- listBox1.Items.Add(textBox2.Text);
- listBox1.Items.Add(textBox3.Text);
- listBox1.Items.Add(comboBox1.Text);
- listBox1.Items.Add(comboBox2.Text);
- }
- private void button3_Click(object sender, EventArgs e)
- {
- listBox1.Items.Clear();
- }
- private void button4_Click(object sender, EventArgs e)
- {
- double litre;
- int n;
- double ostupka;
- double sum;
- litre = Convert.ToDouble(textBox2.Text);
- n = Convert.ToInt32(textBox3.Text);
- ostupka = Convert.ToDouble(comboBox2.Text);
- sum= (litre*n- ((litre * n )* (ostupka / 100)))*1.2;
- textBox4.Text = sum.ToString();
- Form2 f = new Form2(textBox1.Text, textBox2.Text,textBox3.Text, comboBox1.Text, comboBox2.Text);
- f.Show();
- }
- }
- }
- // FORM 2
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace test2
- {
- public partial class Form2 : Form
- {
- String a;
- public Form2(string b,string c,string d,string f,string a)
- {
- InitializeComponent();
- this.a = a+b+c+d+f;
- }
- private void button1_Click(object sender, EventArgs e)
- {
- StreamWriter s=new StreamWriter(@"File.txt");
- s.Write(a);
- s.Close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement