-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathToolbox.cs
42 lines (37 loc) · 990 Bytes
/
Toolbox.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace APH_e_PV
{
public class Toolbox : Form
{
//Cancela o fechamento da janela e só "esconde"
public void CancelaX(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
Hide();
}
// retorna se é número ou não
public string IsNumber(string texto)
{
try
{
double numero;
numero = Convert.ToDouble(texto);
return texto;
}
catch
{
return "INVÁLIDO";
}
}
// retorna mensagem de erro quando inválido
public void InvalidOrNo()
{
MessageBox.Show("Entrada(s) inválida(s). \nUtilize apenas números!");
}
}
}