Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- namespace WindowsFormsApp4
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- }
- private void toolStripMenuItem1_Click(object sender, EventArgs e)
- {
- }
- private void zamknijToolStripMenuItem_Click(object sender, EventArgs e)
- {
- System.Windows.Forms.DialogResult zamknij;
- zamknij = MessageBox.Show(" Czy zamknąć ?", "UWAGA!",
- MessageBoxButtons.YesNo, MessageBoxIcon.Stop,
- MessageBoxDefaultButton.Button1);
- if (zamknij == System.Windows.Forms.DialogResult.Yes)
- {
- Close();
- }
- }
- private void textBox1_TextChanged(object sender, EventArgs e)
- {
- }
- private void obliczToolStripMenuItem_Click(object sender, EventArgs e)
- {
- double U, I, cosy, P, Q, siny,cp,cq,cenap,cenaq;
- string CP, CQ;
- U = Convert.ToDouble(textBox1.Text);
- I = Convert.ToDouble(textBox2.Text);
- cosy = Convert.ToDouble(textBox3.Text);
- siny = Math.Sqrt(1 - (cosy * cosy));
- P = U * I * cosy;
- Q = U * I * siny;
- textBox4.Text = Convert.ToString(P);
- textBox5.Text = Convert.ToString(Q);
- cp = P*(0.000012);
- cq = Q*(0.0005);
- CP = cp.ToString();
- CQ = cq.ToString();
- if (Q > 500)
- MessageBox.Show("Cena za moc czynna wynosi: "+ cp + "\n Cena za moc bierna wynosi: " + cq +);
- else
- MessageBox.Show("Cena za moc czynna wynosi: CP");
- }
- private void label4_Click(object sender, EventArgs e)
- {
- }
- private void label5_Click(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement