
DataGridView
Visual Basic
Publicado el 25 de Junio del 2018 por Luz
2.483 visualizaciones desde el 25 de Junio del 2018
ejemplo de datagridview con un botón.
Public Class Form3
Public Sub New()
InitializeComponent()
Me.ComboBox2.Enabled = True
Me.CONC_CO2.Enabled = True
Me.CONC_O2.Enabled = True
Me.CONC_N2.Enabled = True
Me.Label7.Visible = True
Me.Label8.Visible = True
Me.Button_calcular.Enabled = True
End Sub
Private Sub Form3_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim row0 As String() = {"1", "CO2", "0.133", "44.01", "1462*10-7 g/cm*s"}
Dim row1 As String() = {"2", "O2", "0.039", "32", "2031*10-7 g/cm*s"}
Dim row2 As String() = {"3", "N2", "0.828", "28.02", "1754*10-7 g/cm*s"}
With Me.DataGridView2.Rows
.Add(row0)
.Add(row1)
.Add(row2)
End With
DataGridView1.Rows.Add()
DataGridView1.Rows.Add()
DataGridView1.Rows.Add()
DataGridView1.Rows.Add()
DataGridView1.Rows.Add()
DataGridView1.Rows.Add()
DataGridView1.Rows.Add()
DataGridView1.Rows.Add()
DataGridView1.Rows.Add()
DataGridView1.Rows(0).Cells(0).Value = 1
DataGridView1.Rows(0).Cells(1).Value = 1
DataGridView1.Rows(1).Cells(0).Value = 1
DataGridView1.Rows(1).Cells(1).Value = 2
DataGridView1.Rows(2).Cells(0).Value = 1
DataGridView1.Rows(2).Cells(1).Value = 3
DataGridView1.Rows(3).Cells(0).Value = 2
DataGridView1.Rows(3).Cells(1).Value = 1
DataGridView1.Rows(4).Cells(0).Value = 2
DataGridView1.Rows(4).Cells(1).Value = 2
DataGridView1.Rows(5).Cells(0).Value = 2
DataGridView1.Rows(5).Cells(1).Value = 3
DataGridView1.Rows(6).Cells(0).Value = 3
DataGridView1.Rows(6).Cells(1).Value = 1
DataGridView1.Rows(7).Cells(0).Value = 3
DataGridView1.Rows(7).Cells(1).Value = 2
DataGridView1.Rows(8).Cells(0).Value = 3
DataGridView1.Rows(8).Cells(1).Value = 3
End Sub
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.Text = "Atm" Then
Label7.Text = Text_PRES.Text
Else
If ComboBox1.Text = "Pa" Then
Label7.Text = Text_PRES.Text / 101325
End If
If Label7.Text < 1 Then
MsgBox("Presión fuera del rango.", MsgBoxStyle.Information, "Viscosidad")
ElseIf Label7.Text > 10 Then
MsgBox("Presión fuera del rango.", MsgBoxStyle.Information, "Viscosidad")
Else
If Text_PRES.Text = "" Then
MessageBox.Show("FALTAN DATOS", "INFORMACIÓN", MessageBoxButtons.OK, MessageBoxIcon.Information)
If Text_PRES.Text = "" Then
MsgBox("Introducir Valor a presión.", MsgBoxStyle.Information, "Viscosidad")
ElseIf ComboBox1.SelectedIndex = -1 Then
MsgBox("Seleccionar presión.", MsgBoxStyle.Information, "Viscosidad")
End If
End If
End If
End If
End Sub
Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox2.SelectedIndexChanged
If ComboBox2.SelectedIndex = 0 Then
Label8.Text = ((Text_TEM.Text + 459.47) * 5 / 9)
ElseIf ComboBox2.SelectedIndex = 1 Then
Label8.Text = (Text_TEM.Text + 273)
ElseIf ComboBox2.SelectedIndex = 2 Then
Label8.Text = (Text_TEM.Text)
End If
If Label8.Text < 0 And Label8.Text > 1000 Then
MsgBox("Temperatura fuera del rango.", MsgBoxStyle.Information, "Viscosidad")
Else
If Convert.ToDouble(Label8.Text) < 0 Or Convert.ToDouble(Label8.Text) > 1000 Then
MsgBox("Temperatura fuera del rango.", MsgBoxStyle.Information, "Viscosidad")
ElseIf Text_TEM.Text = "" Then
MsgBox("Introducir Valor a temperatura.", MsgBoxStyle.Information, "Viscosidad")
ElseIf ComboBox2.SelectedIndex = -1 Then
MsgBox("Seleccionar grados.", MsgBoxStyle.Information, "Viscosidad")
ElseIf Text_TEM.Text = "" Then
End If
End If
End Sub
Private Sub Button_salir_Click(sender As Object, e As EventArgs) Handles Button_salir.Click
If MsgBox("¿Desea salir de la aplicación?...", vbQuestion + vbYesNo, "") = vbYes Then
End
End If
End Sub
Private Sub Button_limpiar_Click(sender As Object, e As EventArgs) Handles Button_limpiar.Click
ComboBox1.Text = ""
ComboBox2.Text = ""
Text_TEM.Text = ""
Text_PRES.Text = ""
CONC_CO2.Text = ""
CONC_N2.Text = ""
CONC_O2.Text = ""
Label7.Text = ""
Label8.Text = ""
RES.Text = ""
DataGridView1.Rows(0).Cells(2).Value = ""
DataGridView1.Rows(1).Cells(2).Value = ""
DataGridView1.Rows(2).Cells(2).Value = ""
DataGridView1.Rows(3).Cells(2).Value = ""
DataGridView1.Rows(4).Cells(2).Value = ""
DataGridView1.Rows(5).Cells(2).Value = ""
DataGridView1.Rows(6).Cells(2).Value = ""
DataGridView1.Rows(7).Cells(2).Value = ""
DataGridView1.Rows(8).Cells(2).Value = ""
DataGridView1.Rows(0).Cells(3).Value = ""
DataGridView1.Rows(1).Cells(3).Value = ""
DataGridView1.Rows(2).Cells(3).Value = ""
DataGridView1.Rows(3).Cells(3).Value = ""
DataGridView1.Rows(4).Cells(3).Value = ""
DataGridView1.Rows(5).Cells(3).Value = ""
DataGridView1.Rows(6).Cells(3).Value = ""
DataGridView1.Rows(7).Cells(3).Value = ""
DataGridView1.Rows(8).Cells(3).Value = ""
DataGridView1.Rows(0).Cells(4).Value = ""
DataGridView1.Rows(1).Cells(4).Value = ""
DataGridView1.Rows(2).Cells(4).Value = ""
DataGridView1.Rows(3).Cells(4).Value = ""
DataGridView1.Rows(4).Cells(4).Value = ""
DataGridView1.Rows(5).Cells(4).Value = ""
DataGridView1.Rows(6).Cells(4).Value = ""
DataGridView1.Rows(7).Cells(4).Value = ""
DataGridView1.Rows(8).Cells(4).Value = ""
DataGridView1.Rows(1).Cells(5).Value = ""
DataGridView1.Rows(4).Cells(5).Value = ""
DataGridView1.Rows(7).Cells(5).Value = ""
End Sub
Private Sub Text_TEM_TextChanged(sender As Object, e As EventArgs) Handles Text_TEM.TextChanged
If Text_TEM.Text = "" Then
ComboBox2.Enabled = False
Else
ComboBox2.Enabled = True
End If
End Sub
Private Sub Text_PRES_TextChanged(sender As Object, e As EventArgs) Handles Text_PRES.TextChanged
Dim Numeros As String = "1234567890"
If Text_PRES.Text = "" Then
ComboBox1.Enabled = False
Else
ComboBox1.Enabled = True
End If
If ComboBox1.Text = "Atm" Then
Label7.Text = Text_PRES.Text
Else
If ComboBox1.Text = "Pa" Then
Label7.Text = Text_PRES.Text / 101325
End If
End If
End Sub
Private Sub Text_PRES_KeyPress(sender As Object, e As KeyPressEventArgs) Handles Text_PRES.KeyPress
Dim Linea As String = Text_PRES.Text
Dim Numeros As String = "1234567890"
If Len(Linea) = 0 Then
Numeros += "-"
End If
If Len(Linea) > 0 Then
Numeros += "."
End If
For Each caracter In Numeros
If e.KeyChar = caracter Then
e.Handled = False
Exit For
Else
e.Handled = True
End If
Next
If e.KeyChar = "0" And Mid(Linea, 1, 1) = "0" And Len(Linea) = 1 Then
Text_PRES.Text = ""
ElseIf e.KeyChar <> "0" And e.KeyChar <> "." And Mid(Linea, 1, 1) = "0" And Len(Linea) = 1 Then
Text_PRES.Text = ""
End If
If Char.IsControl(e.KeyChar) Then
e.Handled = False
End If
If e.KeyChar = "." And Not Linea.IndexOf(".") Then
e.Handled = True
End If
End Sub
Private Sub Text_TEM_KeyPress(sender As Object, e As KeyPressEventArgs) Handles Text_TEM.KeyPress
Dim Linea As String = Text_TEM.Text
Dim Numeros As String = "1234567890"
If Len(Linea) = 0 Then
Numeros += "-"
End If
If Len(Linea) > 0 Then
Numeros += "."
End If
For Each caracter In Numeros
If e.KeyChar = caracter Then
e.Handled = False
Exit For
Else
e.Handled = True
End If
Next
If e.KeyChar = "0" And Mid(Linea, 1, 1) = "0" And Len(Linea) = 1 Then
Text_TEM.Text = ""
ElseIf e.KeyChar <> "0" And e.KeyChar <> "." And Mid(Linea, 1, 1) = "0" And Len(Linea) = 1 Then
Text_TEM.Text = ""
End If
If Char.IsControl(e.KeyChar) Then
e.Handled = False
End If
If e.KeyChar = "." And Not Linea.IndexOf(".") Then
e.Handled = True
End If
End Sub
Private Sub CONC_CO2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles CONC_CO2.KeyPress
Dim Linea As String = CONC_CO2.Text
Dim Numeros As String = "1234567890"
If Len(Linea) = 0 Then
Numeros += "-"
End If
If Len(Linea) > 0 Then
Numeros += "."
End If
For Each caracter In Numeros
If e.KeyChar = caracter Then
e.Handled = False
Exit For
Else
e.Handled = True
End If
Next
If e.KeyChar = "0" And Mid(Linea, 1, 1) = "0" And Len(Linea) = 1 Then
CONC_CO2.Text = ""
ElseIf e.KeyChar <> "0" And e.KeyChar <> "." And Mid(Linea, 1, 1) = "0" And Len(Linea) = 1 Then
CONC_CO2.Text = ""
End If
If Char.IsControl(e.KeyChar) Then
e.Handled = False
End If
If e.KeyChar = "." And Not Linea.IndexOf(".") Then
e.Handled = True
End If
End Sub
Private Sub CONC_O2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles CONC_O2.KeyPress
Dim Linea As String = CONC_O2.Text
Dim Numeros As String = "1234567890"
If Len(Linea) = 0 Then
Numeros += "-"
End If
If Len(Linea) > 0 Then
Numeros += "."
End If
For Each caracter In Numeros
If e.KeyChar = caracter Then
e.Handled = False
Exit For
Else
e.Handled = True
End If
Next
If e.KeyChar = "0" And Mid(Linea, 1, 1) = "0" And Len(Linea) = 1 Then
CONC_O2.Text = ""
ElseIf e.KeyChar <> "0" And e.KeyChar <> "." And Mid(Linea, 1, 1) = "0" And Len(Linea) = 1 Then
CONC_O2.Text = ""
End If
If Char.IsControl(e.KeyChar) Then
e.Handled = False
End If
If e.KeyChar = "." And Not Linea.IndexOf(".") Then
e.Handled = True
End If
End Sub
Private Sub CONC_N2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles CONC_N2.KeyPress
Dim Linea As String = CONC_N2.Text
Dim Numeros As String = "1234567890"
If Len(Linea) = 0 Then
Numeros += "-"
End If
If Len(Linea) > 0 Then
Numeros += "."
End If
For Each caracter In Numeros
If e.KeyChar = caracter Then
e.Handled = False
Exit For
Else
e.Handled = True
End If
Next
If e.KeyChar = "0" And Mid(Linea, 1, 1) = "0" And Len(Linea) = 1 Then
CONC_N2.Text = ""
ElseIf e.KeyChar <> "0" And e.KeyChar <> "." And Mid(Linea, 1, 1) = "0" And Len(Linea) = 1 Then
CONC_N2.Text = ""
End If
If Char.IsControl(e.KeyChar) Then
e.Handled = False
End If
If e.KeyChar = "." And Not Linea.IndexOf(".") Then
e.Handled = True
End If
End Sub
Private Sub ComboBox1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles ComboBox1.KeyPress
e.KeyChar = ""
End Sub
Private Sub ComboBox2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles ComboBox1.KeyPress
e.KeyChar = ""
End Sub
Private Sub Button_calcular_Click(sender As Object, e As EventArgs) Handles Button_calcular.Click
If Text_PRES.Text = "" Then
MsgBox("Introducir Valor a presión.", MsgBoxStyle.Information, "presion")
Else
If ComboBox1.SelectedIndex = -1 Then
MsgBox("Seleccionar presión.", MsgBoxStyle.Information, "presion")
Else
If Text_TEM.Text = "" Then
MsgBox("Introducir valor a temperatura.", MsgBoxStyle.Information, "Temperatura")
Else
If ComboBox2.SelectedIndex = -1 Then
MsgBox("Seleccionar temperatura.", MsgBoxStyle.Information, "Temperatura")
Else
If CONC_CO2.Text = "" Then
MsgBox("Introducir Valor a concentración.", MsgBoxStyle.Information, "Concentracion")
Else
If CONC_CO2.Text = "" Then
MsgBox("Introducir Valor a concentración.", MsgBoxStyle.Information, "Concentracion")
Else
If CONC_O2.Text = "" Then
MsgBox("Introducir Valor a concentración.", MsgBoxStyle.Information, "Concentracion")
Else
If CONC_N2.Text = "" Then
MsgBox("Introducir Valor a concentración.", MsgBoxStyle.Information, "Concentracion")
Else
Dim total As Double
total = Val(CONC_CO2.Text) + Val(CONC_N2.Text) + Val(CONC_O2.Text)
Label12.Text = total
If Label12.Text < 1 Then
MsgBox("Concentracion fuera de rango, es menor a 1.", MsgBoxStyle.Information, "Fuera de Rango")
Else
If Label12.Text > 1 Then
MsgBox("Concentracion fuera de rango, es mayor a 1.", MsgBoxStyle.Information, "Fuera de Rango")
Else
Dim conce1, conce2, conce3 As Double
conce1 = (CONC_CO2.Text) / 1000
conce2 = CONC_O2.Text / 1000
conce3 = CONC_N2.Text / 1000
Dim pm_co2, pm_o2, pm_n2 As Double
pm_co2 = 44.01
pm_n2 = 28.02
pm_o2 = 32
Dim visCo2, visO2, visN2 As Double
visCo2 = 1462 * (10 ^ -7)
visN2 = 1754 * (10 ^ -7)
visO2 = 2031 * (10 ^ -7)
Dim M1, V1, Qab1 As Double
Dim M2, V2, Qab2 As Double
Dim M3, V3, Qab3 As Double
Dim M4, V4, Qab4 As Double
Dim M5, V5, Qab5 As Double
Dim M6, V6, Qab6 As Double
Dim M7, V7, Qab7 As Double
Dim M8, V8, Qab8 As Double
Dim M9, V9, Qab9 As Double
Dim s1, s2, s3 As Double
Dim M10 As Double
Dim M11 As Double
Dim M12 As Double
Dim M13 As Double
Dim M14 As Double
Dim M15 As Double
Dim M16 As Double
Dim M17 As Double
Dim M18 As Double
M1 = pm_co2 / pm_co2
M2 = pm_co2 / pm_o2
M3 = pm_co2 / pm_n2
M4 = pm_o2 / pm_co2
M5 = pm_o2 / pm_o2
M6 = pm_o2 / pm_n2
M7 = pm_n2 / pm_co2
M8 = pm_n2 / pm_o2
M9 = pm_n2 / pm_n2
M10 = pm_co2 / pm_co2
M11 = pm_o2 / pm_co2
M12 = pm_n2 / pm_co2
M13 = pm_co2 / pm_o2
M14 = pm_o2 / pm_o2
M15 = pm_n2 / pm_o2
M16 = pm_co2 / pm_n2
M17 = pm_o2 / pm_n2
M18 = pm_n2 / pm_n2
V1 = visCo2 / visCo2
V2 = visCo2 / visO2
V3 = visCo2 / visN2
V4 = visO2 / visCo2
V5 = visO2 / visO2
V6 = visO2 / visN2
V7 = visN2 / visCo2
V8 = visN2 / visO2
V9 = visN2 / visN2
Qab1 = (1 / Math.Sqrt(8)) * ((1 + M1) ^ (-1 / 2)) * (((1 + (V1 ^ (1 / 2)) * (M10 ^ (1 / 4))) ^ 2))
Qab2 = (1 / Math.Sqrt(8)) * ((1 + M2) ^ (-1 / 2)) * (((1 + (V2 ^ (1 / 2)) * (M11 ^ (1 / 4))) ^ 2))
Qab3 = (1 / Math.Sqrt(8)) * ((1 + M3) ^ (-1 / 2)) * (((1 + (V3 ^ (1 / 2)) * (M12 ^ (1 / 4))) ^ 2))
Qab4 = (1 / Math.Sqrt(8)) * ((1 + M4) ^ (-1 / 2)) * (((1 + (V4 ^ (1 / 2)) * (M13 ^ (1 / 4))) ^ 2))
Qab5 = (1 / Math.Sqrt(8)) * ((1 + M5) ^ (-1 / 2)) * (((1 + (V5 ^ (1 / 2)) * (M14 ^ (1 / 4))) ^ 2))
Qab6 = (1 / Math.Sqrt(8)) * ((1 + M6) ^ (-1 / 2)) * (((1 + (V6 ^ (1 / 2)) * (M15 ^ (1 / 4))) ^ 2))
Qab7 = (1 / Math.Sqrt(8)) * ((1 + M7) ^ (-1 / 2)) * (((1 + (V7 ^ (1 / 2)) * (M16 ^ (1 / 4))) ^ 2))
Qab8 = (1 / Math.Sqrt(8)) * ((1 + M8) ^ (-1 / 2)) * (((1 + (V8 ^ (1 / 2)) * (M17 ^ (1 / 4))) ^ 2))
Qab9 = (1 / Math.Sqrt(8)) * ((1 + M9) ^ (-1 / 2)) * (((1 + (V9 ^ (1 / 2)) * (M18 ^ (1 / 4))) ^ 2))
s1 = ((Qab1 * conce1) + (Qab2 * conce2) + (Qab3 * conce3))
s2 = ((Qab4 * conce1) + (Qab5 * conce2) + (Qab6 * conce3))
s3 = ((Qab7 * conce1) + (Qab8 * conce2) + (Qab9 * conce3))
DataGridView1.Rows(0).Cells(2).Value = Truncar(M1, 6)
DataGridView1.Rows(0).Cells(3).Value = Truncar(V1, 3)
DataGridView1.Rows(0).Cells(4).Value = Truncar(Qab1, 3)
DataGridView1.Rows(1).Cells(2).Value = Truncar(M2, 3)
DataGridView1.Rows(1).Cells(3).Value = Truncar(V2, 3)
DataGridView1.Rows(1).Cells(4).Value = Truncar(Qab2, 3)
DataGridView1.Rows(1).Cells(5).Value = Truncar(s1, 3)
DataGridView1.Rows(2).Cells(2).Value = Truncar(M3, 3)
DataGridView1.Rows(2).Cells(3).Value = Truncar(V3, 3)
DataGridView1.Rows(2).Cells(4).Value = Truncar(Qab3, 3)
DataGridView1.Rows(3).Cells(2).Value = Truncar(M4, 3)
DataGridView1.Rows(3).Cells(3).Value = Truncar(V4, 3)
DataGridView1.Rows(3).Cells(4).Value = Truncar(Qab4, 3)
DataGridView1.Rows(4).Cells(2).Value = Truncar(M5, 3)
DataGridView1.Rows(4).Cells(3).Value = Truncar(V5, 3)
DataGridView1.Rows(4).Cells(4).Value = Truncar(Qab5, 3)
DataGridView1.Rows(4).Cells(5).Value = Truncar(s2, 3)
DataGridView1.Rows(5).Cells(2).Value = Truncar(M6, 3)
DataGridView1.Rows(5).Cells(3).Value = Truncar(V6, 3)
DataGridView1.Rows(5).Cells(4).Value = Truncar(Qab6, 3)
DataGridView1.Rows(6).Cells(2).Value = Truncar(M7, 3)
DataGridView1.Rows(6).Cells(3).Value = Truncar(V7, 3)
DataGridView1.Rows(6).Cells(4).Value = Truncar(Qab7, 3)
DataGridView1.Rows(7).Cells(2).Value = Truncar(M8, 3)
DataGridView1.Rows(7).Cells(3).Value = Truncar(V8, 3)
DataGridView1.Rows(7).Cells(4).Value = Truncar(Qab8, 3)
DataGridView1.Rows(7).Cells(5).Value = Truncar(s3, 3)
DataGridView1.Rows(8).Cells(2).Value = Truncar(M9, 3)
DataGridView1.Rows(8).Cells(3).Value = Truncar(V9, 3)
DataGridView1.Rows(8).Cells(4).Value = Truncar(Qab9, 3)
Dim Resultado As Double
Resultado = ((conce1 * visCo2) / s1) + ((conce2 * visO2) / s2) + ((conce3 * visN2) / s3)
RES.Text = Resultado & " g/cm*s"
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Sub
Public Function Truncar(ByVal Numero As Double, Optional ByVal Decimales As Byte = 0) _
As Double
Dim lngPotencia As Long
lngPotencia = 10 ^ Decimales
Numero = Int(Numero * lngPotencia)
Truncar = Numero / lngPotencia
End Function
Private Sub DataGridView2_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView2.CellContentClick
Dim row0 As String = DataGridView2.Rows(0).Cells(0).Value = "1"
DataGridView2.Rows(0).Cells(1).Value = "CO2"
DataGridView2.Rows(0).Cells(2).Value = "0.133"
DataGridView2.Rows(0).Cells(3).Value = "44.01"
DataGridView2.Rows(0).Cells(4).Value = "1462*10-7 g/cm*s"
Dim row1 As String = DataGridView2.Rows(1).Cells(0).Value = "2"
DataGridView2.Rows(1).Cells(1).Value = "O2"
DataGridView2.Rows(1).Cells(2).Value = "0.039"
DataGridView2.Rows(1).Cells(3).Value = "32"
DataGridView2.Rows(1).Cells(4).Value = "2031*10-7 g/cm*s"
Dim row2 As String = DataGridView2.Rows(1).Cells(0).Value = "2"
DataGridView2.Rows(2).Cells(1).Value = "3"
DataGridView2.Rows(2).Cells(2).Value = "N2"
DataGridView2.Rows(2).Cells(2).Value = "0.828"
DataGridView2.Rows(2).Cells(3).Value = "28.02"
DataGridView2.Rows(2).Cells(4).Value = "1754*10-7 g/cm*s"
End Sub
Private Sub RES_KeyPress(sender As Object, e As KeyPressEventArgs) Handles RES.KeyPress
Dim Linea As String = RES.Text
Dim Numeros As String = " "
If Len(Linea) = 0 Then
Numeros += "-"
End If
If Len(Linea) > 0 Then
Numeros += "."
End If
For Each caracter In Numeros
If e.KeyChar = caracter Then
e.Handled = False
Exit For
Else
e.Handled = True
End If
Next
If e.KeyChar = "0" And Mid(Linea, 1, 1) = "0" And Len(Linea) = 1 Then
RES.Text = ""
ElseIf e.KeyChar <> "0" And e.KeyChar <> "." And Mid(Linea, 1, 1) = "0" And Len(Linea) = 1 Then
RES.Text = ""
End If
If Char.IsControl(e.KeyChar) Then
e.Handled = False
End If
If e.KeyChar = "." And Not Linea.IndexOf(".") Then
e.Handled = True
End If
End Sub
Private Sub RES_TextChanged(sender As Object, e As EventArgs) Handles RES.TextChanged
End Sub
Private Sub Label12_Click(sender As Object, e As EventArgs) Handles Label12.Click
End Sub
Private Sub Label7_Click(sender As Object, e As EventArgs) Handles Label7.Click
If Label7.Text < 1 Then
MsgBox("Presión fuera del rango.", MsgBoxStyle.Information, "Viscosidad")
ElseIf Label7.Text > 10 Then
MsgBox("Presión fuera del rango.", MsgBoxStyle.Information, "Viscosidad")
Else
If Text_PRES.Text = "" Then
MessageBox.Show("FALTAN DATOS", "INFORMACIÓN", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End If
End Sub
End Class
Comentarios sobre la versión: 3.33 (0)
No hay comentarios