Solved

VB .Net

Posted on 2002-06-10
7
181 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
  • 3
  • 3
7 Comments
 
LVL 22

Accepted Solution

by:
mnasman 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now