Aurel62190
Messages postés22Date d'inscriptiondimanche 21 juin 2009StatutMembreDernière intervention 7 septembre 2009
-
8 juil. 2009 à 14:23
Aurel62190
Messages postés22Date d'inscriptiondimanche 21 juin 2009StatutMembreDernière intervention 7 septembre 2009
-
8 juil. 2009 à 18:03
Bonjour à tous,
Dans une FORM, j'ai mis un commandbutton et un usercontrol et plein d'autres choses, et dans ce usercontrol j'ai mis un textbox. Le truc c'est que j'essai de mettre le focus dans ce textbox en cliquant depuis mon commandbutton.
Pour ecrire depuis le commandbutton, j'y arrive, mais j'arrive pas à mettre ce fichu focus
Dans le usercontrol, pour ecire dans le textbox, j'ai tapé ceci :
Property Let Text(ByVal valeur As String)
UserControl.TextBox.Text = valeur
End Property
Property Get Text() As String
Text = UserControl.TextBox.Text
End Property
Est-ce que quelqu'un connaît la propiété à taper pour un focus ?
PCPT
Messages postés13280Date d'inscriptionlundi 13 décembre 2004StatutMembreDernière intervention 3 février 201848 8 juil. 2009 à 17:01
j'avais dit "de tête"
je viens de faire l'essai, tout semble ok :
Option Explicit
Public Property Get
Text()
As String
Text = UserControl.TextBox.Text
End Property
Public Property Let Text(ByVal Valeur As String)
UserControl.TextBox.Text = Valeur
End Property
Property Get SelText() As String
SelText = UserControl.TextBox.SelText
End Property
Property Let SelText(ByVal Valeur As String)
UserControl.TextBox.SelText = Valeur
End Property
Public Sub SetFocus()
UserControl.TextBox.SetFocus
End Sub
Aurel62190
Messages postés22Date d'inscriptiondimanche 21 juin 2009StatutMembreDernière intervention 7 septembre 20091 8 juil. 2009 à 18:03
c'est vrai que ça marche sur un nouveau projet.
En fait dans mon usercontrol, il y avait un tabstrip et un sstab.
Je les ai retiré puis je les ai remis, et maintenant ça marche !!! en tout cas merci à toi !!!