473,748 Members | 4,067 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(i ndex 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,SomeHTM LCode)
Else
Write(1,OtherHT ML 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 2253

"John" <I_*********@mi crosoft.com> wrote in message
news:eX******** ******@TK2MSFTN GP15.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.s pam> 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/vbtchCreatingCo ntrolArraysInVi sualBasicNETVis ualCNET.asp>

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

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

Control Array
<URL:http://windowsforms.ne t/default.aspx?ta bindex=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
4230
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
4465
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 accomplish. // - - - - - - - - begin code - - - - - - - typedef int sm_t; typedef int bg_t; sm_t sm; bg_t bg;
0
2011
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 User Private _UserName As String Private _UserCity As String <System.ComponentModel.CategoryAttribute("User Info")> _ Public Property UserName() As String Get
9
312
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 manually. Location, visibility, etc... There is no support for converting a VB6 project to VB.NET that implemented control arrays.
5
1365
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
19646
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) What's the difference between these 3 statements: (i) memcpy(&b, &KoefD, n); // this works somewhere in my code
5
2283
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 suggestions on a better way to do it. GalenS
1
2449
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 of different lengths (e.g. usually between 25 and 45 rows. The columns in each file have the same length). The text files have been numbered sequentially e.g. cb0, cb1, cb2 and so on. I would like to read the data from each text file into...
5
1751
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 that moved the img boxes in the array by random amounts whilst checking for collisions etc. and it worked, for one lane. I designed a module that would theoretically allow the movement of every lane without having to constantly repeat lines of code....
0
8991
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9544
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
6796
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4606
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2783
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.