
| |||
![]() Hola amigos, tengo una duda simple,....pero no recuerdo como hacerlo y por culpa de un virus he perdido mis demos para recordar....tengo 6 textbox y un combobox en el combo selecciono un cliente y en los textbox escribo sus datos...bien ahora viene lo que no recuerdo...no quiero utilizar un botón guardar...eso no me vale, quiero que al llegar al último textbox...al pulsar enter se me pase todo a un datagridview....alguna ayudita por favor?? ![]() |
| |||
Respuesta: Pasar textbox al grid por cierto el código que tengo es este, graciassssssss Public Sub guardalineaFactura() Dim adapta2 As New OleDbDataAdapter Dim datavacio As New DataSet 'Try Dim comados = conexion.CreateCommand comados.CommandType = CommandType.Text comados.CommandText = "INSERT INTO LineasFacturas (Id,RefProveedor,Plu,NomProducto,NUnidades,Formato Compra,Cantidad,PtsUndsCompra,Dto,PtsBotella,TipoI va,TotalLinea,UndsCompra,FechaCaduca,IdCaduca) values (@Id,@RPro,@Plu,@Prod,@Nuni,@Fc,@Cant,@PtsUn,@Dto, @PtsBot,@TIv,@TL,@UndC,@FCa,@IdC)" & _ "SELECT @@Identity" 'Dim Id As OleDbParameter Dim Ref As OleDbParameter Dim plu As OleDbParameter Dim Nom As OleDbParameter Dim Nun As OleDbParameter Dim FC As OleDbParameter Dim can As OleDbParameter Dim ptu As OleDbParameter Dim dto As OleDbParameter Dim pbo As OleDbParameter Dim tiv As OleDbParameter Dim tol As OleDbParameter Dim undc As OleDbParameter Dim fcad As OleDbParameter Dim idc As OleDbParameter Ref = New OleDbParameter("@Ref", OleDbType.WChar) plu = New OleDbParameter("@plu", OleDbType.Integer) Nom = New OleDbParameter("@Nom", OleDbType.WChar) Nun = New OleDbParameter("@Nun", OleDbType.SmallInt) FC = New OleDbParameter("@FC", OleDbType.SmallInt) can = New OleDbParameter("@can", OleDbType.Single) ptu = New OleDbParameter("@ptu", OleDbType.Single) dto = New OleDbParameter("@dto", OleDbType.Single) pbo = New OleDbParameter("@pbo", OleDbType.Single) tiv = New OleDbParameter("@tiv", OleDbType.Integer) tol = New OleDbParameter("@tol", OleDbType.Single) undc = New OleDbParameter("@undc", OleDbType.Single) fcad = New OleDbParameter("@fcad", OleDbType.Date) idc = New OleDbParameter("@idc", OleDbType.WChar) Ref.Value = Me.TextRefProvee.Text plu.Value = Me.TextPlu.Text Nom.Value = Me.Comboproducto.Text Nun.Value = Me.TextTUnid.Text FC.Value = Me.TextFComp.Text can.Value = Me.TextUnd.Text '(cantidad) ptu.Value = Me.TextPrecio.Text '(ptsundscompra) dto.Value = Me.TextDto.Text pbo.Value = Me.TextPUnid.Text tiv.Value = Me.TextIva.Text tol.Value = Me.TextTotalLinea.Text undc.Value = Me.TextUltimoPrecio.Text fcad.Value = Me.TextFechaC.Text idc.Value = Me.TextIdCaduca.Text comados.Parameters.Add(Ref) comados.Parameters.Add(plu) comados.Parameters.Add(Nom) comados.Parameters.Add(Nun) comados.Parameters.Add(FC) comados.Parameters.Add(can) comados.Parameters.Add(ptu) comados.Parameters.Add(dto) comados.Parameters.Add(pbo) comados.Parameters.Add(tiv) comados.Parameters.Add(tol) comados.Parameters.Add(undc) comados.Parameters.Add(fcad) comados.Parameters.Add(idc) conexion.Open() Dim nu As Integer = CInt(comados.ExecuteScalar()) ' Actualizar() conexion.Close() Return Última edición por guillebomtrasmiti; 15/05/2011 a las 05:00 |
| |||
Respuesta: Pasar textbox al grid Con lo que te comenta tiger015 puedes solucionar lo de la tecla, ya solo restaria realizar la insersión de tus Datos a tu Base de Datos y recargar la información en el DataGridView.
__________________ http://ka0stj.wordpress.com/ |
| ||||
Respuesta: Pasar textbox al grid Opino igual que Ka0stj lo que te propuso tiger015 puede resolver tu duda. Saludos! ![]()
__________________ Internet es tener todo el conocimiento global a tu disposición. Desarrollo de Software - Ejemplos .Net |
| ||||
Respuesta: Pasar textbox al grid Holaaaaaaaaaaaaa! pillinuelo! ![]()
__________________ Internet es tener todo el conocimiento global a tu disposición. Desarrollo de Software - Ejemplos .Net |
| |||
Respuesta: Pasar textbox al grid ayudarme un poquito más me dice que keychar no es un miembro de system.eventargs.... me podeis escribir como desarrollarlo,¿en un public function...o en el click de los textbox...no se gracias |
| ||||
Respuesta: Pasar textbox al grid Mmmm guille tu textbox es un control creado por codigo(controles dinamicos)?
__________________ Internet es tener todo el conocimiento global a tu disposición. Desarrollo de Software - Ejemplos .Net |
| |||
Respuesta: Pasar textbox al grid he conseguido pasar del último textbox al primero para que el cliente vuelva a empezar con la siguiente línea de la factura...pero no consigo que me baje al datagrid view ...mirad Private Sub txtRefProvee_KeyPress(ByVal sender As Object, _ ByVal e As System.Windows.Forms.KeyPressEventArgs) _ Handles TextIdCaduca.KeyPress ' Si se pulsa la tecla Intro, pasar al siguiente If e.KeyChar = Convert.ToChar(Keys.Return) Then 'If e.KeyChar = ChrW(Keys.Return) Then e.Handled = True TextRefProvee.Focus() ElseIf e.KeyChar = "."c Then ' si se pulsa en el punto se convertirá en coma e.Handled = True SendKeys.Send(",") End If End Sub |
| ||||
Respuesta: Pasar textbox al grid No te pasa nada al datagridview porque no hay ningun codigo que digas TuDatagridView.Rows.Add("xxx","xxx",....), es decir en tu codigo puesto no hay ninguna accion de agregado al DGV
__________________ Internet es tener todo el conocimiento global a tu disposición. Desarrollo de Software - Ejemplos .Net |
| ||||
Respuesta: Pasar textbox al grid jajaja vamos guille ya no te pongo mucho codigo porque quiero que aprendas a pescar ![]() ![]()
__________________ Internet es tener todo el conocimiento global a tu disposición. Desarrollo de Software - Ejemplos .Net |
| |||
Respuesta: Pasar textbox al grid Private Sub txtRefProvee_KeyPress(ByVal sender As Object, _ ByVal e As System.Windows.Forms.KeyPressEventArgs) _ Handles TextIdCaduca.KeyPress ' Si se pulsa la tecla Intro, pasar al siguiente If e.KeyChar = Convert.ToChar(Keys.Return) Then 'If e.KeyChar = ChrW(Keys.Return) Then e.Handled = True TextRefProvee.Focus() guardalineaFactura() ElseIf e.KeyChar = "."c Then ' si se pulsa en el punto se convertirá en coma e.Handled = True SendKeys.Send(",") End If End Sub LISTOOOOOO PARA QUIEN LO NECESITO, EL CÓDIGO DE ARRIBA QUE PONGO AL PRINCIPIO DE ESTA PREGUNTA....LO CARGO CUANDO LO MANDO PARA EL PRIMER TEXTBOX....JAJAJAJA...aquaaaaaaaa lo hizeeeeeeeeeeeee |
| ||||
Respuesta: Pasar textbox al grid Lo Sabía ![]()
__________________ Internet es tener todo el conocimiento global a tu disposición. Desarrollo de Software - Ejemplos .Net |
Etiquetas: |