-
Notifications
You must be signed in to change notification settings - Fork 0
/
ResisParalelo.cs
63 lines (51 loc) · 1.65 KB
/
ResisParalelo.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Calculador
{
public partial class ResisParalelo : Form
{
public ResisParalelo()
{
InitializeComponent();
MenuPrincipal.abriu();
lbl_resultado.Text = "0Ω";
}
private void Label4_Click(object sender, EventArgs e)
{
}
private void Entrada_2_TextChanged(object sender, EventArgs e)
{
entrada_2.Text = entrada_2.Text.Split('Ω')[0] + 'Ω';
}
private void BtCalcula_Click(object sender, EventArgs e)
{
float resistor1 = 0.0f;
float resistor2 = 0.0f;
float associacao;
resistor1 = float.Parse(entrada_1.Text.Split('Ω')[0]);
resistor2 = float.Parse(entrada_2.Text.Split('Ω')[0]);
associacao = ( resistor2 * resistor1 ) / (resistor1 + resistor2);
lbl_resultado.Text = associacao.ToString() + "Ω";
}
private void Entrada_1_TextChanged(object sender, EventArgs e)
{
entrada_1.Text = entrada_1.Text.Split('Ω')[0] + 'Ω';
}
private void BtSair_Click(object sender, EventArgs e)
{
MenuPrincipal.fecho();
Close();
}
private void BtLimpa_Click(object sender, EventArgs e)
{
entrada_1.Text = "0Ω";
entrada_2.Text = "0Ω";
lbl_resultado.Text = "0Ω";
}
}
}