I have a form with a tabcontrol and 4 tabs. I want to open a form with showdialog in a predetermined tab.
I’ve tried
OptionsForm.OPTS_TabControl1.SelectTab(1)
OptionsForm.OPTS_TabControl1.ShowDialog()
but it didn’t work.
Any help? thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First Kudos for using Stackoverflow. It shows you paid attention to class =D
regarding your question, that piece of code you showed should be working. You should provide the actual error so we can try to figure out.
Does OptionsForm refer to the class or an object of a class you created?
Anyways, try to create an object of the form and then set the starting tab, like this:
Another solution might be Overloading the Showdialog method, although it seems kind of an overshot.
Here’s how:
Inside your OptionsForm Code:
then call the form using
Note: Overloading is basically creating another instance of a subrotine that accepts different arguments. read the pages 342-358 of the manual if you wish to know more.