Hello All,
I am a beginner in VB.NET, so please excuse me if you find my question stupid.:drunk:
There are 4 sets of textboxs in the my Windows form. Their names are like below:
Set 1: HBD_NDT1, HBD_NDT2, HBD_NDT3, HBD_NDT4, HBD_NDT5
Set 2: HBD_NDP1, HBD_NDP2, HBD_NDP3, HBD_NDP4, HBD_NDP5
Set 3: HBD_UDT1, HBD_UDT2, HBD_UDT3, HBD_UDT4, HBD_UDT5
Set 4: HBD_UDP1, HBD_UDP2, HBD_UDP3, HBD_UDP4, HBD_UDP5
In the form I have four check boxes for each set of textboxs defined above. e.g. if user clicks on first check box than all the 5 textboxs of first set shall be enabled & so on...
Earlier, I made this application in MS Excel 2010 VBA editor. At that time i used following codes:
Private Sub Checkbox2_Change() ' this type of sub was defined for all the four checkboxs
Call Set_Design_Box("HBD_UDP", Me.Checkbox2.Value)
End Sub
Public Sub Set_Design_Box(ByVal Box_Name As String, ByVal Status As Boolean)
Dim c As Integer
If Status = True Then
For c = 1 To 5
Me.Controls(Box_Name & c).Enabled = True
Next
Else
For c = 1 To 5
Me.Controls(Box_Name & c).Enabled = False
Next
End If
End Sub
Now, I am currently writing this codes in VBA 2010. Does anyone has idea how i can loop through selective textboxs using loops.
Please do help me.
Thanks in advance.
== Akash
I am a beginner in VB.NET, so please excuse me if you find my question stupid.:drunk:
There are 4 sets of textboxs in the my Windows form. Their names are like below:
Set 1: HBD_NDT1, HBD_NDT2, HBD_NDT3, HBD_NDT4, HBD_NDT5
Set 2: HBD_NDP1, HBD_NDP2, HBD_NDP3, HBD_NDP4, HBD_NDP5
Set 3: HBD_UDT1, HBD_UDT2, HBD_UDT3, HBD_UDT4, HBD_UDT5
Set 4: HBD_UDP1, HBD_UDP2, HBD_UDP3, HBD_UDP4, HBD_UDP5
In the form I have four check boxes for each set of textboxs defined above. e.g. if user clicks on first check box than all the 5 textboxs of first set shall be enabled & so on...
Earlier, I made this application in MS Excel 2010 VBA editor. At that time i used following codes:
Private Sub Checkbox2_Change() ' this type of sub was defined for all the four checkboxs
Call Set_Design_Box("HBD_UDP", Me.Checkbox2.Value)
End Sub
Public Sub Set_Design_Box(ByVal Box_Name As String, ByVal Status As Boolean)
Dim c As Integer
If Status = True Then
For c = 1 To 5
Me.Controls(Box_Name & c).Enabled = True
Next
Else
For c = 1 To 5
Me.Controls(Box_Name & c).Enabled = False
Next
End If
End Sub
Now, I am currently writing this codes in VBA 2010. Does anyone has idea how i can loop through selective textboxs using loops.
Please do help me.
Thanks in advance.
== Akash