Public Class Pref Public val As String Public pos As New List(Of String) Public butt As New List(Of String) End Class
Public Sub New(Byval pVal as String,byval ptPos as string(), ByVal ptButt as string()) val =pVal pos =new List(Of String) pos.AddRange(ptPos) butt=new List(Of String) butt.AddRange(ptButt) end sub
Public Class Pref Public val As String Public pos As List(Of String) Public butt As List(Of RadioButton) Public Sub New(ByVal pVal As String, ByVal ptPos As String(), ByVal ptButt As RadioButton()) val = pVal pos = New List(Of String) pos.AddRange(ptPos) butt = New List(Of RadioButton) butt.AddRange(ptButt) End Sub End Class
Dim show_userroms As New Pref("false", New String() {"true", "false"}, {A1, A2})
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPublic Class Pref Public val As Boolean Public pos As List(Of Boolean) Public butt As Integer Public Sub New(ByVal pVal As String, ByVal ptPos As String(), ByVal pButt As Integer) val = pVal pos = New List(Of Boolean) pos.AddRange(ptPos) butt=pButt End Sub End Class Public Class Form1 Dim prefUser As Pref Dim lLstRadio as list(of RadioButton)=list(of RadioButton) Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load lLstRadio.AddRange(new RadioButton(){RadioButton1,RadioButton2,RadioButton3,RadioButton4,...}) prefUser=New Pref(false,new Boolean(){true,false},GetIndexSelected) End Sub Private Function GetIndexSelected() As Integer For i As Integer=0 To lLstRadio.Count-1 If lLstRadio(i).Checked then Return i Next End Function End Class