Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

rendre UC visible et affecter propriété à partir d'un autre UC

2 réponses
Avatar
herve
Bonjour

Quand se produit un événement dans un UC ("ucIdent"), je voudrai:
- rendre visible un UC ("ucAfficMsg")
- affecter un texte à la propriété Public ReadOnly Property msgErrTxt()
As String d'un label contenu dans cet UC ("ucAfficMsg")

Du genre qui ne fonctionne pas :
CType(Me.Parent.FindControl("ucAfficMsg"), UserControl).Visible = True
CType(Me.Parent.FindControl("ucAfficMsg"), UserControl).msgErrTxt=
"Informations "

une idée, un exemple !?
hervé

2 réponses

Avatar
c2i-Richard Clark [MVP]
CType(Me.Parent.FindControl("ucAfficMsg"), UserControl).Visible = True
Remplace UserControl par le nom de la classe de ton UC (nom complet)

--
Richard Clark
http://www.c2i.fr - Le portail .NET
[Microsoft MVP .NET]
______________________________________________
'Au coeur de VB .NET' (MS Press, 430 pages, 34 euros)
http://www.amazon.fr/exec/obidos/ASIN/2100065645/c2ifrleportad-21
______________________________________________

"herve" wrote in message
news:
Bonjour

Quand se produit un événement dans un UC ("ucIdent"), je voudrai:
- rendre visible un UC ("ucAfficMsg")
- affecter un texte à la propriété Public ReadOnly Property msgErrTxt()
As String d'un label contenu dans cet UC ("ucAfficMsg")

Du genre qui ne fonctionne pas :
CType(Me.Parent.FindControl("ucAfficMsg"), UserControl).Visible = True
CType(Me.Parent.FindControl("ucAfficMsg"), UserControl).msgErrTxt > "Informations "

une idée, un exemple !?
hervé


Avatar
herve
c2i-Richard Clark [MVP] a écrit :
CType(Me.Parent.FindControl("ucAfficMsg"), UserControl).Visible = True
Remplace UserControl par le nom de la classe de ton UC (nom complet)



merci celà fonctionne.