I have the following routine that searces for a control and removes it from a tabpage.
However, I also have need to pass the form, but if I use something like frm.tab, I obviously get an error that tab's not a member of frm.
So, the first part of my question is how can I accomplish this.
The latter part, which is probably going to be answered the same way is - how can I move this to a module? I have a custom class where I need access to the same sub - I'd rather have only one instance instead of dropping a second in the other class...
Private Sub DestroyControl(ByVal strName As String, ByVal tab As TabPage)
Dim ctl() As Control = tab.Controls.Find(strName, True)
If ctl.Length > 0 Then
ctl(0).Visible = False
ctl = Nothing