Having problem using a class

ninjatalon

Member
Joined
Sep 22, 2010
Messages
24
Programming Experience
Beginner
I have a form that i made a TabControl.

In this TabControl i have 7 tabs, in each tab Im trying to populate in real time an array labels and checkboxes.

I made a couple of functions inside a module that will do that on 1 tab but my problem is that i need them in all tabs but they can't be the same labels and checkboxes.

So i know i need to create a class and create 7 objects of each but for some reason I am not stuck with an error message "Index was outside the bounds of the array." for all my arrays

This only happens when i use it in a class but not in a module. Here is my source code for that class.

Can someone show me what I'm doing wrong. Thanks
 

Attachments

  • ClassMeals.txt
    10.8 KB · Views: 18
You should create a UserControl. Add one to your project the same way you do a form. Design it the same way you do a form. You can then build your project and your UserControl will appear in the Toolbox along with all the other controls. You can then add it to a form, or a TabPage, just as you do any other control.
 
Yep, that's exactly what I mean. The idea of a UserControl is to allow you to group multiple child controls together into a re-usable unit and then treat that just like you do any other control.
 
Back
Top