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

Is there LabelArray (VB6) in C#?

Greetings all.

I have a program that I've written in VB6 and now want to re-code in C#. But
I have a problem in that there is no LabelArray in C# like there is in VB6.
Is there any easy way to do this VB6 LabelArray in C#?

Scott
Dec 30 '05 #1
3 2521
Scott Starker wrote:
Greetings all.

I have a program that I've written in VB6 and now want to re-code in C#. But
I have a problem in that there is no LabelArray in C# like there is in VB6.
Is there any easy way to do this VB6 LabelArray in C#?

Scott


I think the most natural way would be to create a collection of the
labels and add them to the form programatically.

Probably seems like a pain in the ass compared to VB but when you get
into it, it is no problem. I tried it with .net 2 and the new generic
List class simplified it somewhat. You could probably simplify it
further by extending the List to handle some of the stuff you have to do
programatically (setting coordinates, naming, tabindex etc.)
Dec 30 '05 #2
You could also declare it like this, assuming a 5-label array:

Label[] labelArray = new Label[5];
string[] labelText = new string[] { "Label 0", "Label 1", "Label 2", "Label
3", "Label 4" };
for (int i = 0; i < 5; i++)
{
labelArray[i] = new Label();
labelArray[i].Text = labelText[i];
}
Dec 31 '05 #3
Hmmm... I didn't think of it like that. Thanks.

If anyone has a problem with VB LabelArray you should check out
http://msdn.microsoft.com/library/de...visualcnet.asp
The article is about ButtonArray but it works just fine using LabelArray.

"David Veeneman" <da****@nospam.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
You could also declare it like this, assuming a 5-label array:

Label[] labelArray = new Label[5];
string[] labelText = new string[] { "Label 0", "Label 1", "Label 2",
"Label 3", "Label 4" };
for (int i = 0; i < 5; i++)
{
labelArray[i] = new Label();
labelArray[i].Text = labelText[i];
}

Jan 3 '06 #4

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

Similar topics

4
by: Kieran Benton | last post by:
Hi everyone, I'm just looking into this for my boss (and myself I suppose). What is the current state of VB6 to VB.NET converters out there and what are they? I'm trying to convince our company to...
3
by: Peter | last post by:
Hi, My C# application is supposed to cooperate with legacy VB6 code, but I am little bit worried if and how far C# strings, double etc. in the method interfaces will work smoothly from VB6...
16
by: Ben Hannon | last post by:
Hi, I'm writting a COM Class in VB.NET to be used in a VB6 project (Tired of the VB6 hassles with cloning and serializing an object). All my classes I need cloneable/serializable are now in a...
13
by: Metallicraft | last post by:
I have a vb6 application. On the main form is a picture box with one or two images and several pieces of text displayed in it. These are created on the fly using gdi32 routines that are all in a...
66
by: Mitchell S. Honnert | last post by:
In some recent posts, I've seen people who seem to be waxing nostalgic with respect to the "ease of use" of Visual Basic 6. I can't quite put my finger on it, but they seem to be implying that VB6...
9
by: Terry | last post by:
I am converting (attempting) some vb6 code that makes vast use of interfaces. One of the major uses is to be able to split out Read-only access to an obect. Let me give you a simple (contrived)...
10
by: AK | last post by:
Hello All, We received this in response to a question we had posed at a trade show meeting. Our proposed app's target features consist of a business application to crunch numbers, show...
15
by: Aalaan | last post by:
I am presently a user of classic vb6 and hang out on those newsgroups. Some of you may be aware that there is a very anti MS and vb2005 feeling there. I have tried to get them to tell me which...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.