Hello Daniweb Community,
I was wondering if there is a way to reset a tabcontrol.
What I'm wanting to do is have it so when the user will click New it will reset all the tabpages to the way they were when they started the program up.
Some have textboxes, pictureboxes, groupboxes (with radiobuttons).
I don't really want to have to clear them manually like each control (Textbox1.Text = Nothing, PictureBox1.Image = Nothing, RadioButton1.Check = True, etc...)
You can make a function, pass a tab as parameter. In that function loop all controls of the tab and depending on the type clear the text, remove the image and so on.
For Each cntrl As Control In TabPage1.Controls // make tabpage1 a parameter
If TypeOf cntrl Is PictureBox Then
cntrl.Image = Nothing
If TypeOf cntrl Is TextBox Then
cntrl.Text = Nothing
// and so on