473,386 Members | 1,698 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,386 software developers and data experts.

Control arrays... the loss of (index As Integer)

Hello everyone,

I'm currently writing a program to keep track of schedule changes at a
school. The goal is to have someone using the program to declare changes,
then the program writes a html file, which is uploaded to a webserver. Then
students and teachers can view it online, but there are also a couple of
computers with 19" monitors standing around the school to display the
webpage (IE kiosk mode).

The program has a form containing a tab control. It holds one tabpage for
each day of schedule changes (students need to be able to know of schedule
changes at least one day ahead of time, javascript on the webpage will
autoredirect after a few seconds to make sure all pages can be viewed). Each
tabpage contains several textboxes in which the scheduler can type the
changes, as well as a few checkboxes for the html layout, and a button to
write and upload the html file. All tabpages are identical in layout (no
code written yet, in fact the layout isn't completed either, but that's
because I got stuck on the problem described below).

Now obviously I need the same parsing algorythm to parse data into the html
file on each tab, using the text boxes and checkboxes on that tab. I had
originally planned to have all the controls on one tab, copying them and
pasting copies on each new tab. In VB 6 this would have given me control
arrays of each box, with the index numbers corresponding to the tabpage
index number (first tab having index 0, second index 1 etc.). This would
make sure I only needed 1 very simple procedure to write the HTML:

Sub Button1_Click(index as Integer.... etc.)
Open test.html For Output As #1
Write(1, textbox1(index).text)
Write(1, textbox2(index).text)
If Checkbox1(index).Checked Then
Write(1,SomeHTMLCode)
Else
Write(1,OtherHTML Code)
End If

etc.
End Sub

I guess you already guessed where the glitch is: control arrays no longer
exist in VB .NET 2003. So basically I'm lost. I don't want to create
tabpage-specific coding, especially because that's gonna make it a hell of a
lot harder to add and remove tab pages with the exact same controls
(something which was extremely easy in VB 6). Plus it's gonna be very ugly
and bulky, as you need n times as much procedures, n being the number of
tabpages... so yeah, I'm pretty much lost.

I read up on some of the articles replacing the control arrays with
collections. Will they do the job? That is, can I use them to write common
handlers using indexes to keep track which control fired up the event and
use the same indexes with the textboxes etc. etc.? If so, how? Any
recommended reading?

Any help much appreciated,

John
Nov 21 '05 #1
2 2228

"John" <I_*********@microsoft.com> wrote in message
news:eX**************@TK2MSFTNGP15.phx.gbl...
I guess you already guessed where the glitch is: control arrays no longer
exist in VB .NET 2003.


Newsgroup searches are a good thing*. A thread was just recently posted
called "control arrays." Here's a link that was provided in one of the
replies:

http://msdn.microsoft.com/vbasic/usi...et05132003.asp


* http://www.google.com/groups
Nov 21 '05 #2
Jeff,

* "Jeff Johnson [MVP: VB]" <i.***@enough.spam> scripsit:
I guess you already guessed where the glitch is: control arrays no longer
exist in VB .NET 2003.


Newsgroup searches are a good thing*. A thread was just recently posted
called "control arrays." Here's a link that was provided in one of the
replies:

http://msdn.microsoft.com/vbasic/usi...et05132003.asp


Some additional links on this topic I have collected over the time:

Creating Control Arrays in Visual Basic .NET and Visual C# .NET:
<URL:http://msdn.microsoft.com/library/en-us/dv_vstechart/html/vbtchCreatingControlArraysInVisualBasicNETVisualCN ET.asp>

Getting Back Your Visual Basic 6.0 Goodies
<URL:http://msdn.microsoft.com/library/en-us/dnadvnet/html/vbnet05132003.asp>

WinForms Controls--Creating Control Arrays in VB.NET
<URL:http://www.devx.com/vb2themax/Article/19907/>

Control Array
<URL:http://windowsforms.net/default.aspx?tabindex=5&tabid=47&ItemID=16>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

34
by: Christopher Benson-Manica | last post by:
If an array is sparse, say something like var foo=; foo=4; foo='baz'; foo='moo'; is there a way to iterate through the entire array? --
11
by: truckaxle | last post by:
I am trying to pass a slice from a larger 2-dimensional array to a function that will work on a smaller region of the array space. The code below is a distillation of what I am trying to...
0
by: Tom | last post by:
I am having a really annoying issue with serialization and a .NET User Control I am writing. For example, let's say I have a couple of classes in my control - first class is like: Public Class...
9
by: Jay | last post by:
Why is it publisized that VB.NET does not support control arrays? This is not true. It is just that it is implemented in another way. Dim txtNumbers(10) as TextBox Everything must be done...
5
by: Hugh | last post by:
Hi there, How to dim a array of arrays and index it? Let's say, array of 10 elements with each element is a (8, 12) 2-D array. Thanks in advance for your help. Hugh
39
by: Martin Jørgensen | last post by:
Hi, I'm relatively new with C-programming and even though I've read about pointers and arrays many times, it's a topic that is a little confusing to me - at least at this moment: ---- 1)...
5
by: Galen Somerville | last post by:
Just looking for thoughts on converting VB6 Control arrays. Here's the way I did it. The control happens to be a Usercontrol, CircVol, but could be any control. I would appreciate any...
1
by: Doug_J_W | last post by:
I have a Visual Basic (2005) project that contains around twenty embedded text files as resources. The text files contain two columns of real numbers that are separated by tab deliminator, and are...
5
by: Sedecrem | last post by:
I am creating a 'frogger' like game. Essentially there are ten lanes each with an image array associated with it. The arrays are named from imglane0() to imglane9(). I was creating a piece of code...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.