-
Oct 13th, 2020, 04:32 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] VB.net Accessing control on a tabcontrol second tab page on another form
Hi
I have a problem when trying to set the selected index of a combobox that is on a from from a shared/public class. I get no error when I do that for another combobox (called CB_Update_CaseID in the image below) that is on the 3rd TabPage but I get the following error for the combobox that is on the 4th page:
How will I solve this issue?
thanks in advance.
and apology for the title that says "second tab page".
Edit,
OK, comparing the properties of those two Combos revealed that the "Modifier" property for the problematic combo was set to "Private". Issue solved.
Last edited by Grand; Oct 13th, 2020 at 04:45 AM.
-
Oct 13th, 2020, 06:29 AM
#2
Re: [RESOLVED] VB.net Accessing control on a tabcontrol second tab page on another fo
What you're doing is bad practice. The "proper" way to do it is to write a method in the target form and let it do the work itself, then simply call that method from the other form. All your controls should be Private and they are in C# by default. They are Friend by default in VB because Microsoft assume that VB developers are more likely to do things the quick and dirty way whereas C# developers are more likely to do things the proper way.
-
Oct 14th, 2020, 01:26 AM
#3
Thread Starter
Fanatic Member
Re: [RESOLVED] VB.net Accessing control on a tabcontrol second tab page on another fo
Thanks for highlighting that. I also see that this is not the proper way to do it. There will be a clean up.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|