472,807 Members | 3,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,807 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 2180

"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: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.