• Martes 14 de Mayo de 2024, 21:27

Mostrar Mensajes

Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.


Mensajes - DriverSoftVzla

Páginas: [1]
1
VB .NET / Re: TextBox.lostfocus, Toolstrip
« en: Sábado 6 de Noviembre de 2010, 16:31 »
Amigo, gracias por escribir.

Hice la prueba y de esta forma logra pasar por el lostFocus, pero no se detiene el TxtCodigo.Focus.
Como se cancela el llamado al ToolStripButton?

Muchas Gracias.

2
VB .NET / TextBox.lostfocus, Toolstrip
« en: Martes 2 de Noviembre de 2010, 17:59 »
Hola amigos.

Dentro del LostFocus de un textbox valido si el código existe, si me muevo a otro objeto del formulario todo bien, el problema se me presenta cuando clickeo sobre algún botón del objeto ToolStrip. al clikear sobre el boton del toolstrip no se ejecuta el evento LostFocus del textBox.

 Private Sub TxtCodigo_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TxtCodigo.LostFocus
        If Existe_Registro() Then
            TSSLabel.Text = "  EL REGISTRO: " & TxtCodigo.Text & ", YA EXISTE, ASIGNE OTRO CODIGO "
            Beep()
            TxtCodigo.Focus()
         End Sub


Agradezco sus ayudas y comentarios. Gracias

3
VB .NET / Re: Eliminar La última Fila de un DataGridView
« en: Jueves 23 de Julio de 2009, 07:36 »
Hola, gracias por responder.

Permiteme escribir algo en mayuscula,  MUCHAS GRACIAS

y ahora si, nada en mayus.

Tomando tu ejemplo se me prendio el bombillo, y lo hice asi, claro aun estoy averiguando como controlo cuando cambie de fila con el mouse, pero mientras tenemos este adelanto:

Protected Overrides Function ProcessCmdKey(ByRef msg As System.Windows.Forms.Message, ByVal keyData as
  System.Windows.Forms.Keys) As Boolean

         If (Not _DGV1.Focused) AndAlso _
            (Not _DGV1.IsCurrentCellInEditMode) Then Return MyBase.ProcessCmdKey(msg, keyData)

        Select Case keyData

              Case Keys.Up, Keys.Down, Keys.         'Eliminar Fila Vacia
                 If Eliminar_Fila_Vacia() Then
                     Return True
                  End If

              Case Keys.F8
                 If Me._DGV1.Rows(Me._DGV1.CurrentCell.RowIndex).Cells(0).Selected Then         'Cells(0) es la columna CODIGO
                    SeleccionarCodigo()
                 End If

       End Select

       Return MyBase.ProcessCmdKey(msg, keyData)

 End Function

 
 Private Function Eliminar_Fila_Vacia() As Boolean
        Dim i As Integer = _DGV1.CurrentCell.RowIndex               'Indice Fila a Eliminar
        If (_DGV1.RowCount > 0) Then
            If _DGV1.Rows(i).Cells(0).Value() = String.Empty Then
                _DGV1.Rows.Remove(Me._DGV1.CurrentRow)              'Elimina Fila
                _DGV1.CurrentCell = _DGV1.Rows(i - 1).Cells(0)      'Selecciono Celda Anterior
                Return True
            End If
        End If
        Return False
    End Function

4
VB .NET / Eliminar La última Fila de un DataGridView
« en: Domingo 19 de Julio de 2009, 05:58 »
HOLA AMIGOS.

LES HECHO EL CUENTO:
TENGO UN DATAGRIDVIEW DESCONECTADO, LO QUE QUIERO ES ELIMINAR LA ULTIMA FILA CUANDO ESTA VACIA, PERO QUIERO QUE LO HAGA AUTOMATICAMENTE. ME EXPLICO, SI ESTOY EN LA ULTIMA FILA Y ME MUEVO A LA FILA ANTERIOR, QUIERO QUE LA ELIMINE AUTOMATICAMENTE.

SI LO HAGO MANUALMENTE FUNCIONA, EJEMPLO:

     Case Keys.F4     'Elimina Una Fila del DatagridView
     If (_DGV1.RowCount > 0) Then
           Me._DGV1.Rows.Remove(Me._DGV1.CurrentRow)
     End If

HE PROBADO ELIMINARLA EN LOS EVENTOS: RowValidating, RowValidated, RowLeave
EJEMPLO:

Private Sub _DGV1_RowValidated(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles _DGV1.RowValidated
If (_DGV1.RowCount > 0) Then
If _DGV1.Rows(e.RowIndex).Cells(0).Value() = String.Empty Then
Me._DGV1.Rows.Remove(Me._DGV1.CurrentRow)
End If
End If
End Sub

Y ARROJA: "La operación no se puede realizar en este controlador de eventos"

NO SE DONDE HACERLO, GRACIAS POR TODA LA AYUDA PRESTADA.

Páginas: [1]