473,406 Members | 2,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

vb-Checkbox Array? Sample Code needed

Hi there.
I've read a previous thread regarding the Old VB 6 checkbox array and how it's not really needed any more.
That's fine, but I'm not really sure how to implement the checkbox control array in .NET.
I am using an ARCGIS map control which has "Layers" of spatial data (i.e. Roads, Creeks, Rivers, etc.)
When I load the form and the map control, I want to create a Dynamic Table of Contents in the form of Check Boxes in order to control whether the Layers will be visible or not.
Can someone please supply a sample snippet of code that will create an array of check boxes?

Here is my code, but I'm getting errors regarding "Use the 'NEW' keyword..."

CODE

'GET THE NUMBER OF LAYERS FROM THE MapControl
Dim NumLayers as Integer
NumLayers = AxMapControl1.LayerCount

'CREATE NEW CHECKBOX CONTROL ARRAY
Dim MyCheckboxes As New CheckBox()

'LOOP THROUGH THE LAYERS AND CREATE A CHECKBOX FOR EACH
Dim i As Integer
For i = 0 To NumLayers - 1
'if the number of layers is 5 our Layer array will be 0 to 4

'CYCLE THROUGH AND POPULATE CHECKBOXES

MyCheckboxes(i).Visible = True
MyCheckboxes(i).Checked = True
MyCheckboxes(i).Text = AxMapControl1.Map.Layer(i).Name

Next i
/CODE

I have done this in the past with VB 6 with no problems.
Can someone please supply a sample snippet of code that will create an array of check boxes?
Thanks.
Nolan
Sep 11 '07 #1
0 1624

Sign in to post your reply or Sign up for a free account.

Similar topics

43
by: Spare Change | last post by:
This is a recommendation to Microsoft. VB.net and c# are almost exactly equivalent. I know why Microsoft invented VB.net -- to wean old style VB6 scripters into a true OO world: .Net. But...
53
by: Jon S via DotNetMonster.com | last post by:
Hi all, I'm planning on developing an ASP.NET web site. I know both VB.NET and C# but am unsure on which would be more useful to develop an ASP.NET site with? Also I maybe looking to become a...
182
by: Jim Hubbard | last post by:
http://www.eweek.com/article2/0,1759,1774642,00.asp
39
by: clintonG | last post by:
This is not about starting a fight but an observation that seems to be proving itself on its own merit and is therefore simply a point of conjecture. I did not get serious about writing software...
14
by: clarence_rollins | last post by:
I've read that the framework is completely accessible to c#. Is that true for VB? If not, what parts of the framework are not accessible to VB?
64
by: Milan | last post by:
Hello, I would like to ask you this question. I am experienced in programming in VBA and I want to upgrade my knowledge to Visual Studio 2005 now. I hesitate whether to aim to VB or C#. Since I...
18
by: verity_susan | last post by:
Gooday Guys The firm I work for want to finally make shift to vb.net. We use 6.0 for mainly a load of desktop db apps (accounting - boring I know). Some of the people that I work with want to...
13
by: Ben | last post by:
Hi all, I have been using the FSO object in in my Excel/ Access and VB 6 development from the ScriptingRuntime library. I am just starting to use a VS 2002 and VS 2005 Express. I am wondering...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.