Transistores
Enviado por Francisco Pérez • 20 de Septiembre de 2015 • Apuntes • 6.371 Palabras (26 Páginas) • 260 Visitas
Public Class frm_matriz
Private Sub bt_dim_A_Click(sender As Object, e As EventArgs) Handles bt_dim_A.Click
Dim i As Integer
ncolA = Val(txt_col_A.Text)
nrowA = Val(txt_fila_A.Text)
mat_A.Cols = ncolA
mat_A.Rows = nrowA
For i = 0 To ncolA - 1
mat_A.set_ColWidth(i, 600)
Next
End Sub
Private Sub bt_dim_B_Click(sender As Object, e As EventArgs) Handles bt_dim_B.Click
Dim i As Integer
ncolB = Val(txt_col_B.Text)
nrowB = Val(txt_fila_B.Text)
mat_B.Cols = ncolB
mat_B.Rows = nrowB
For i = 0 To ncolB - 1
mat_B.set_ColWidth(i, 600)
Next
End Sub
Private Sub mat_A_Enter(sender As Object, e As EventArgs) Handles mat_A.Enter
End Sub
Private Sub mat_A_KeyDownEvent(sender As Object, e As AxMSFlexGridLib.DMSFlexGridEvents_KeyDownEvent) Handles mat_A.KeyDownEvent
If e.keyCode = 46 Then
mat_A.Text = ""
End If
End Sub
Private Sub mat_A_KeyPressEvent(sender As Object, e As AxMSFlexGridLib.DMSFlexGridEvents_KeyPressEvent) Handles mat_A.KeyPressEvent
Dim contenido As String
Dim menos As Boolean
Dim punto As Boolean
Dim cant As Integer
Dim i As Integer
Dim letra As String
menos = False
punto = False
contenido = mat_A.Text
cant = Len(contenido)
letra = Mid(contenido, 1, 1)
If letra = "-" Then
menos = True
Else
menos = False
End If
For i = 1 To cant
letra = Mid(contenido, i, 1)
If letra = "." Then
punto = True
i = cant + 1
End If
Next
If (48 <= e.keyAscii And e.keyAscii <= 57) Then
mat_A.Text = contenido & Chr(e.keyAscii)
ElseIf e.keyAscii = 46 And punto = False Then
mat_A.Text = contenido & Chr(e.keyAscii)
ElseIf e.keyAscii = 45 And cant = 0 Then
mat_A.Text = contenido & Chr(e.keyAscii)
ElseIf e.keyAscii = 45 And cant <> 0 Then
mat_A.Text = -1 * Val(contenido)
ElseIf e.keyAscii = 13 Then
If mat_A.Col < mat_A.Cols - 1 Then
mat_A.Col = mat_A.Col + 1
ElseIf mat_A.Col = mat_A.Cols - 1 Then
mat_A.Col = 0
If mat_A.Row < mat_A.Rows - 1 Then
mat_A.Row = mat_A.Row + 1
ElseIf mat_A.Row = mat_A.Rows - 1 Then
mat_A.Row = 0
mat_B.Row = 0
mat_B.Col = 0
mat_B.Focus()
End If
End If
ElseIf e.keyAscii = 8 Then
...