Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
User control
Message
De
26/11/2008 04:00:10
 
 
À
26/11/2008 00:00:33
Arjun Bagojikop
Dynamic Super Software
Sangli, Inde
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Titre:
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01363973
Message ID:
01364143
Vues:
14
>Thanks Viv
>
>but i am adding no of buttons in my form through user control custom property like this
>Private nbtn, i As Integer
> Private oradio As New System.Windows.Forms.RadioButton
> Dim cntrx As Integer = Me.Location.X
> Dim octr As Control
>
>
> Property Buottos() As Integer
> Get
> Return nbtn
> End Get
> Set(ByVal value As Integer)
> nbtn = value
>
>
>
> Me.Controls.Clear()
> For i = 1 To nbtn
> Dim btn1 As New System.Windows.Forms.RadioButton
>
> Me.Controls.Add(btn1)
> btn1.Text = "Radiobtn" + i.ToString.Trim
> btn1.AutoSize = True
> btn1.Location = New System.Drawing.Point(i * 80, 3)
>
> 'oradio.Name = "rb" + i.ToString.Trim
> Next
>
> End Set
> End Property

Hi,
I think you are saying that the above code works (in that setting the Buottos() property causes the buttons to be created as expected) but that you are somehow expecting to then be able to access properties of these buttons in the designer?

But the same situation applies as in my previous post - the user control itself must provide public properties if access to internal objects is required. You could try maintaining a public generic list of RadioButtons and add to this list in the Buottos Set. But for this to work I think the property would need to be serializable and I don't know if that is the case.

Regards,
Viv
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform