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

control array

Can anyone show me how to make control array like created in vb6?

I am making one program in vb.net 2002 using winsock control (provided with vb6). so whenever new connection request comes, it loads new winsock control. this program i can make it in vb 6. but i want to use the same technology with vb.net 2002 using winsock control only.

thanks in advance,

K
Nov 21 '05 #1
6 3793
Kishan,

You cannot make a controlarray as in VB6 (whatever that is) in VBNet.

However you can make for every control an array of controls by instance
doing this
\\\
dim myformcontrols() as control = New Control() {textbox1, button2, etc}
///
You can make as much arrays of controls as you want.

Every control holds itself already a collection of all the controls it
contents which is by instance accessable by
\\\
for each ctr as control in me.controls
ctr.text = "mytext"
next
///
With this your controls on a form have all the text "mytext"

I hope this helps?

Cor

"Kishan Hathiwala" <ki****@hathiwala.fateback.com>
Can anyone show me how to make control array like created in vb6?

I am making one program in vb.net 2002 using winsock control (provided with
vb6). so whenever new connection request comes, it loads new winsock
control. this program i can make it in vb 6. but i want to use the same
technology with vb.net 2002 using winsock control only.

thanks in advance,

K
Nov 21 '05 #2
Actually, there is no control arrays in VB.NET because event handlers can be
shared using the Handles keyword. Check this article for more info:
http://msdn.microsoft.com/library/de...trolarrays.asp

"Kishan Hathiwala" <ki****@hathiwala.fateback.com> wrote in message
news:#$**************@TK2MSFTNGP10.phx.gbl...
Can anyone show me how to make control array like created in vb6?

I am making one program in vb.net 2002 using winsock control (provided with
vb6). so whenever new connection request comes, it loads new winsock
control. this program i can make it in vb 6. but i want to use the same
technology with vb.net 2002 using winsock control only.

thanks in advance,

K
Nov 21 '05 #3
thanks for your reply...

this is what i do in vb6 when used to use it.

client side coding:
put a command button and winsock control naming btntemp and wsktemp.
And assume that server where this client will connect is "tempserver"

btntemp click event
wsktemp.close
wsktemp.connect "tempserver", 8547
wsktemp connect event:
msgbox "winsock connected"

wsktemp error event:
msgbox description

server side coding:
put a textbox and winsock control naming txttemp and wsktemp.
and change the following property of wsktemp.
index = 0

form load event:
wsktemp(0).close
wsktemp(0).localport = 8547
wsktemp(0).listen

wsktemp connectionrequest event:
load wsktemp(wsktemp.ubound + 1)
wsktemp(wsktemp.ubound).close
wsktemp(wsktemp.ubound).accept (requestid)

wsktemp error event:
msgbox description
thats it...
now if i want to write the same kind of codding in vb.net, is it possible to write? if it is then can you just show with sample coding?

thanks.

K
Nov 21 '05 #4
Hi Kishan,

When you want detailed Upgrade information than I advise you to ask this as
well in the newsgroup
microsoft.public.dotnet.languages.vb.upgrade

In that newsgroup Herfried (I call it often Herfrieds own newsgroup) and
others takes mostly some more time to give answers on this kind of
questions.

However when you want help from Herfried and others it is better to set your
message not in HTML because mostly by instance Herfried ignores that when he
is short of time.

Cor

"Kishan Hathiwala" ki****@hathiwala.fateback.com

thanks for your reply...

this is what i do in vb6 when used to use it.

client side coding:
put a command button and winsock control naming btntemp and wsktemp.
And assume that server where this client will connect is "tempserver"

btntemp click event
wsktemp.close
wsktemp.connect "tempserver", 8547
wsktemp connect event:
msgbox "winsock connected"

wsktemp error event:
msgbox description

server side coding:
put a textbox and winsock control naming txttemp and wsktemp.
and change the following property of wsktemp.
index = 0

form load event:
wsktemp(0).close
wsktemp(0).localport = 8547
wsktemp(0).listen

wsktemp connectionrequest event:
load wsktemp(wsktemp.ubound + 1)
wsktemp(wsktemp.ubound).close
wsktemp(wsktemp.ubound).accept (requestid)

wsktemp error event:
msgbox description
thats it...
now if i want to write the same kind of codding in vb.net, is it possible to
write? if it is then can you just show with sample coding?

thanks.

K
Nov 21 '05 #5
Cor Ligthert wrote:
Kishan,

You cannot make a controlarray as in VB6 (whatever that is)


Hopefully, you're joking (you must be). VB6, aka VB.Cool, aka VB Classic
is the last release of Visual anything that actually used the Basic
language. It was the last release of a development tool that could
actually read/use code from previous versions up to and including 10+
year old versions. In fact, most Basic code ran find in VB6. Even late
1970's DOS basic with minor modifications.

No comparison to this new "throw my code away for each new release" B#

fwiw, VB Classic code's safer too when it comes to decompilation
(especially decompilation) and general security threats. Note that
Windows Update is updating components written in C++.

RAD is not productivity
"Barring use of Win32 API calls, VB6 was remarkably immune to all of
these problems. Makes you wonder who’s been writing the bad code,
doesn’t it?"
http://www.danappleman.com/index.php?p=4

--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..
Nov 21 '05 #6
Ken,

I explicitly wrote it as I did, Controlarray as in VB6 and array of controls
as used in VBNet.

http://msdn.microsoft.com/library/de...alBasicNET.asp

I explicitly wrote it that way to give no discussions with VB6 dyhards as
Jef who give me than this page. My text "whatever that is" was meant because
the VB6 controlarray is of course as well an array of controls.

Now I get a reply from another VB6 dyhard in the other way.

:-)

Cor
"Ken Halter"
..
Cor Ligthert wrote:
Kishan,

You cannot make a controlarray as in VB6 (whatever that is)


Hopefully, you're joking (you must be). VB6, aka VB.Cool, aka VB Classic
is the last release of Visual anything that actually used the Basic
language. It was the last release of a development tool that could
actually read/use code from previous versions up to and including 10+ year
old versions. In fact, most Basic code ran find in VB6. Even late 1970's
DOS basic with minor modifications.

No comparison to this new "throw my code away for each new release" B#

fwiw, VB Classic code's safer too when it comes to decompilation
(especially decompilation) and general security threats. Note that Windows
Update is updating components written in C++.

RAD is not productivity
"Barring use of Win32 API calls, VB6 was remarkably immune to all of these
problems. Makes you wonder who’s been writing the bad code, doesn’t it?"
http://www.danappleman.com/index.php?p=4

--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..

Nov 21 '05 #7

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

Similar topics

4
by: The Mess | last post by:
I would like to pass a Control array of OptionButtons that I created at run time to a Sub. Say I have Opt(0), Opt(1)......Opt(5) as OptionButtons, is there a way to pass Opt to a function and...
3
by: Mani | last post by:
Hi, can anyone help me on how to create a control array in C++ builder like we create in VB. I have another question regarding controls. I want to clear a group of text boxes in the form on a...
10
by: James McGivney | last post by:
I have a project in ASP.NET using C#. I have a large number of Button Controls and a large number of ImageButton Controls. It would be convienent if I could refer to a specific control by it's...
3
by: Mark Broadbent | last post by:
In VB6 (using visual studio) it was possible to create a control array at design time by simply adding the control (e.g. textbox) and renaming it to what would become the first element e.g. ...
6
by: chxant | last post by:
Hi, I want to use a parameter in a control name. Something like this: i=1; (CheckBox + i).ID="test"; Is this possible?
4
by: bienwell | last post by:
Hi all, Data displayed on the datalist control is bound by the column name of the dataset like this : <%# DataBinder.Eval(Container.DataItem, "title")%> Could I use an element of the array...
2
by: George | last post by:
Is there a fast way to transfer an Excel range to an array? Example: Excel range is E2:E300 Dim person() as string Thanks, George
14
by: Jim Burns | last post by:
I just started with vb.net and I don't understand why there are no control arrays. what replaced them. I was trying to do drag and drop(What happened with that) and it looked like with no control...
6
by: Rich | last post by:
Hello, I have an application that contains several checkboxes. I originally created this app in VB.Net 2003 and upgraded the app to VB.Net 2005. I understand the vb2005 supports control...
9
by: =?Utf-8?B?VG9tbXkgTG9uZw==?= | last post by:
I don't know if the following is what you are looking for, but to me what you described was using a control array. If you were using vb6 that would be easy, the following articles hopefully...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.