que textbox tiene el foco?

20/10/2004 - 12:29 por vicvallo | Informe spam
Hola amigos!
Tengo el siguiente problema. Tengo unos cuantos textbox y un trackbar.
Dependiendo del textbox que tenga el foco, el trackbar debe modificar el
textbox.text del textbox que tenga el foco, es decir, si tiene el foco el
textbox1 el trackbar modificara el valor del 1, si luego paso al 2 el
trackbar modificara el valor del 2.
Como puedo hacer esto? alguien me puede ayudar?

Saludos

Preguntas similare

Leer las respuestas

#6 Cesarion
22/10/2004 - 20:41 | Informe spam
modifica los dos procedimientos que te envio de la siguiente manera y prueba
de nuevo. bye, suerte.

'debes declarar un objeto temporal donde almacenes el texto que tiene el foco.
dim txtTemporal as TextBox
' el parametro i no va.
Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TrackBar1.Scroll
'aca preguntas si alguno tiene el foco, o sea si el temporal es
diferente de nothing
If Not (txtTemporal Is Nothing) Then
txtTemporal.Text = TrackBar1.Value.ToString()
End If
End Sub

Private Sub Text_Leave(ByVal sender As Object, ByVal e As
System.EventArgs) Handles txt_camara(i).Leave(aqui marca
error)
txtTemporal.Text = CType(sender, TextBox)
End Sub

"vicvallo" escribió:

Ufff que lio. Vamos a ver, escribo el codigo porque tengo muchos errores, y
ahora mismo estoy echo un lio.


Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As
System.EventArgs, ByVal i As Integer) Handles TrackBar1.Scroll(aqui marca
error)
If Not (txt_camara(i).Text Is Nothing) Then
txt_camara(i).Text = TrackBar1.Value.ToString()
End If
End Sub


Private Sub Text_Leave(ByVal sender As Object, ByVal e As
System.EventArgs, byval i as Integer) Handles txt_camara(i).Leave(aqui marca
error)
txt_camara(i).Text = CType(sender, TextBox)
End Sub

Private Sub Form_Temperatura_Camaras_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load


For i As Integer = 0 To Rs_Camara.Count - 1

txt_camara(i) = New TextBox
txt_camara(i).Location = New System.Drawing.Point(88, 56 + (i * 25))
txt_camara(i).Size = New System.Drawing.Size(64, 20)
Me.Controls.Add(txt_camara(i))
AddHandler txt_camara(i).Leave, AddressOf Me.txt_camara_Leave(aqui
marca error)

rs_camara.movenext

next

ALGUIEN ME PUEDE AYUDAR!!! ESTOY MUY PERDIDO

GRACIAS


email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una pregunta AnteriorRespuesta Tengo una respuesta
Search Busqueda sugerida