Solved

VB .Net

Posted on 2002-06-10
7
189 Views
Last Modified: 2013-11-25
Hi iam new in Visual Basic .Net , and i was shocked when i discovered that there are not a control array or at least i can not find the way , with VB6 i was able to build a control array , i was able to build a new control of it within the run time by using

Load control name(index)

where that in VB.Net
Thanx
0
Comment
Question by:ashraf_t
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 50 total points
ID: 7068561
Hello

  the Control of array removed from vb.net, so you will not able to use it in the vb.net

Look at ms site
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconcontrolarraychangesinvisualbasicnet.asp

and look also here for some talks about that in the newsgroups
http://groups.google.com/groups?hl=en&lr=&ie=UTF8&oe=UTF8&selm=e6FOuhLCBHA.1316%40tkmsftngp07
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 7068564
I have not used .net yet, but my Java experience may apply since VB.Net seems to function in a similar way.

In Java, you also do not have control arrays.  To create a control array in Java, you actually create an object array, then set each object to the desired control, after which you can use the control as needed.
0
 

Author Comment

by:ashraf_t
ID: 7069123
for  mnasman , okay i read the example and it can create 10 button inside the run time , that is one good step but the other important thing is how to deal with these buttons , the example show how to  build a click event to it but what i want is for example how i change the text of the  buttons not when i build it but in another part of the programe in another time

in VB6 i was able to say

button name(index).caption =....
in any part of my program

how that in VB.Net
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:ashraf_t
ID: 7075207
what happened , is this question is hard to be answered????
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 7076241
I think the answer is yes and no.

Not too many experts have jumped up to .net yet, so there is a limit number who have started learning it.

Since VB.Net is so different from VB6, there are many things to learn.

My suggestion is to resubmit the question with the title "VB.Net control arrays"

--
Did you try to dimension an array of objects?
From there, can you set the objects to an control of the desired class?  ...something like this (again, I've only done it in Java...a while back...so the syntax may be slightly different):

Dim objSomeControl() as Object
Dim txtSomeControl as TextBox

ReDim objSomeControl(5)

set txtSomeControl = objSomeControl(0)

txtSomeControl.Text = "this is a test"

Set objSomeControl(0) = txtSomeControl
0
 

Author Comment

by:ashraf_t
ID: 7081552
No it doesnot work :(
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 7084176
Well, again:
My suggestion is to resubmit the question with the title "VB.Net control arrays"
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Suggested Courses
Course of the Month4 days, 18 hours left to enroll

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question