
05/02/2008, 14:08
|
 | | | Fecha de Ingreso: febrero-2008
Mensajes: 37
Antigüedad: 17 años, 1 mes Puntos: 0 | |
Re: Acceso a las propiedades de controles en VB.NET ya conseguí el código para realizarlo y es el siguiente: PrivateSub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.ClickDim x, i, j AsInteger Dim campos AsString = "" Dim valores AsString = "" Dim TXT AsNew TextBox Dim DT AsNew DateTimePicker Dim rb AsNew RadioButton Dim grp AsNew GroupBox For x = 0 ToMe.Controls.Count - 1 If Me.Controls(x).Name Like "grp*" Then grp = Me.Controls(x) For i = 0 To grp.Controls.Count - 1 If grp.Controls(i).Name Like "txt*" Then TXT = grp.Controls(i) If valores > "" Then valores &= "¬" valores &= "'" & TXT.Text & "'" End If End If If grp.Controls(i).Name Like "dt*" Then DT = grp.Controls(i) DT.CustomFormat = "yyyyMMdd" DT.Format = DateTimePickerFormat.Custom If valores > "" Then valores &= "¬" valores &= "'" & DT.Text & "'" End If End If If grp.Controls(i).Name Like "grp*" Then Dim grp1 As GroupBox grp1 = Controls(i) For j = 0 To grp1.Controls.Count - 1 If grp1.Controls(j).Name Like "rb*" Then If rb.Checked = True Then If valores > "" Then valores &= "¬" valores &= "'" & txt5.Text & "'" End If End If End If Next End If Next End If Next If O.InsertData(campos, valores) = False Then MsgBox("no insertó nada en la BD", MsgBoxStyle.Critical, _ "Mensaje...") Else MsgBox("Si insertó en la BD", MsgBoxStyle.Information, _ "Mensaje...") End If End Sub |