In VB6 I made heavy use of control arrays
I see they have been 'deprecated' in vb.Net, with a questionable explanation
that they are no longer necessary which just addresses the event issue!
Problem is I commonly associated several other controls with the same index
inside the event handler - eg a
Directory listbox, Label, Checkbox, Textbox Drivebox etc all associated with
identical index.
Now I see Control arrays belong to VB6 compatibility.
So how in a converted VB6 program can I extend the control arrays at design
time? or run-time for that matter?
I guess VB6 compatibility creates a run-time array of controls with related
type and names - am I right?
So do I need to create a Control object array at form load time, and replace
control references with array references? Is that how VB6 compatibility
does it?
How do other people handle control arrays in .Net
Thanks! 8 2323
Sorry - double post due to Outlook-Express reported server error
Greg,
This newsgroups is full of this.
In VBNet has every control an controlcollecti on. That is as well for the
form itself.
However what you probably need is something as
\\\
dim ctrArray() as Control = Control() {textbox1, textbox2, combobox1, etc}
///
When you use it with a special property/method of a control (not needed for
by instance "name") than you have to do
\\\
If typeof ctr(x) Is combobox then
directcast(ctr, combobox).selec tedindex = 1
End it
///
I hope this helps?
Cor
"Greg" <Gr**@discussio ns.microsoft.co m> In VB6 I made heavy use of control arrays I see they have been 'deprecated' in vb.Net, with a questionable explanation that they are no longer necessary which just addresses the event issue! Problem is I commonly associated several other controls with the same index inside the event handler - eg a Directory listbox, Label, Checkbox, Textbox Drivebox etc all associated with identical index.
Now I see Control arrays belong to VB6 compatibility.
So how in a converted VB6 program can I extend the control arrays at design time? or run-time for that matter?
I guess VB6 compatibility creates a run-time array of controls with related type and names - am I right?
So do I need to create a Control object array at form load time, and replace control references with array references? Is that how VB6 compatibility does it?
How do other people handle control arrays in .Net
Thanks!
Thanks for your reply - I was hoping to find something to give me DESIGN Time
control arrays; I think Ken Tucker and Herfried Wagner have answered my
question in the double-posted thread; thank you
But it's no surprise that the Group is full of this particular issue! It
was quite a shock to find something so useful and flexible discarded with no
obvious benefit
"Cor Ligthert" wrote: Greg,
This newsgroups is full of this.
In VBNet has every control an controlcollecti on. That is as well for the form itself.
However what you probably need is something as \\\ dim ctrArray() as Control = Control() {textbox1, textbox2, combobox1, etc} /// When you use it with a special property/method of a control (not needed for by instance "name") than you have to do \\\ If typeof ctr(x) Is combobox then directcast(ctr, combobox).selec tedindex = 1 End it /// I hope this helps?
Cor
"Greg" <Gr**@discussio ns.microsoft.co m> In VB6 I made heavy use of control arrays I see they have been 'deprecated' in vb.Net, with a questionable explanation that they are no longer necessary which just addresses the event issue! Problem is I commonly associated several other controls with the same index inside the event handler - eg a Directory listbox, Label, Checkbox, Textbox Drivebox etc all associated with identical index.
Now I see Control arrays belong to VB6 compatibility.
So how in a converted VB6 program can I extend the control arrays at design time? or run-time for that matter?
I guess VB6 compatibility creates a run-time array of controls with related type and names - am I right?
So do I need to create a Control object array at form load time, and replace control references with array references? Is that how VB6 compatibility does it?
How do other people handle control arrays in .Net
Thanks!
Greg, But it's no surprise that the Group is full of this particular issue! It was quite a shock to find something so useful and flexible discarded with no obvious benefit
Only from persons who come just from VB6. After a while they don't want that
probably no more because there are so much VBNet methods which give more
control to do what you want, almost endless and when you know them easier to
use.
Cor
"Cor Ligthert" <no************ @planet.nl> schrieb: But it's no surprise that the Group is full of this particular issue! It was quite a shock to find something so useful and flexible discarded with no obvious benefit
Only from persons who come just from VB6. After a while they don't want that probably no more because there are so much VBNet methods which give more control to do what you want, almost endless and when you know them easier to use.
I disagree. Control arrays were one important part of the real RAD
experience of VB Classic, because they provided an easy-to-use design-time
support.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Herfried,
I know that you disagree that, I have often seen that in this newsgroup.
It is often that people love there first programming language they were real
active with and cannot see the worse things of it.
However an advise try to leave that behaviour.
Learn to look at your first programminglang uage even with more distance than
others.
And watch to embrace not directly any marketing message that fits what you
want to see. When others who never used VB6 however are expirienced in VBNet
that it is good, than you have a better measuring point.
And those people are probably even younger than you.
However just an advise feel free to do with it what you want.
Cor
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> "Cor Ligthert" <no************ @planet.nl> schrieb: But it's no surprise that the Group is full of this particular issue! It was quite a shock to find something so useful and flexible discarded with no obvious benefit
Only from persons who come just from VB6. After a while they don't want that probably no more because there are so much VBNet methods which give more control to do what you want, almost endless and when you know them easier to use.
I disagree. Control arrays were one important part of the real RAD experience of VB Classic, because they provided an easy-to-use design-time support.
-- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
"Cor Ligthert" <no************ @planet.nl> schrieb: It is often that people love there first programming language they were real active with and cannot see the worse things of it.
VB Classic was not my first programming language.
However an advise try to leave that behaviour.
Why? Give me some reasons why control arrays (+ design-time support) are so
bad that I should not use them.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
> "Cor Ligthert" <no************ @planet.nl> schrieb: It is often that people love there first programming language they were real active with and cannot see the worse things of it.
VB Classic was not my first programming language.
I took a long time to describe it the way I did, to avoid this message
however I did not succeed. I know that already, however in my opinion is VB6
the the first you embraced.
:-) However an advise try to leave that behaviour.
Why? Give me some reasons why control arrays (+ design-time support) are so bad that I should not use them.
It is not the discussing point, the point is that the ones who want to
discuss this have all a very deep VB6 background. That does not mean I did
not used it, however I am almost forgotten what it was.
The only thing I rembember me is that I first found it sad that the control
array was gone, and now that I have seen so much better aproaches for that
am afraid that it comes back and people start using it again.
I thought to remember me that it was one of my first questions in this
newsgroup which you answered. (Beside that favorites, what still is great,
was it I thought as well one of your last answers on programming questions
from me)
:-).
Cor This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Canonical Latin |
last post by:
"Leor Zolman" <leor@bdsoft.com> wrote
> "Canonical Latin" <javaplus@hotmail.com> wrote:
>
> > ...
> >But I'm still curious as to the rational of having type
> >pointer-to-array-of-size-N-of-type-T (which is fine) and not having type
> >array-of-size-N-of-type-T (with some exceptions, which is curious).
> > So far
> >the consensus seems to be that while everyone is aware of this no one
knows
|
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?
--
|
by: Hal Styli |
last post by:
/*hello could someone please help me with the
errors i get related to pointers to arrays of ints.
I want to declare something like
int *d = { 7, 11, 18, 54, 64, 55, 37, 38, };
rather than
int d = { 7, 11, 18, 54, 64, 55, 37, 38, };
It seems to work in the code below but I get compile
warnings and Im concerned about portability.
|
by: Merrill & Michele |
last post by:
What follows is an adaptation of the second program in K&R §5.10. The
changes are to elucidate (validate) the difference (sameness) of char *
and char**. I cannot for the life of me understand why the output looks the
way it does, in particular, with all the symmetry in arguments, why one sees
apple but not argv. This program was designed to run from a command
line with one argument (two if you count the prog name). The .c file...
|
by: Greg Lesnie |
last post by:
In VB6 I made heavy use of control arrays
I see they have been 'deprecated' in vb.Net, with a questionable explanation
that they are no longer necessary!
Problem is I commonly associated several controls with the same index - eg a
Directory listbox, Label, Checkbox, Textbox etc
Now I see Control arrays belong to VB6 compatibility.
So how in a converted VB6 program can I extend the control arrays at design
time? or run-time for that...
| |
by: I.M. !Knuth |
last post by:
Hi. I'm more-or-less a C newbie. I thought I had pointers under control until
I started goofing around with this:
================================================================================
/* A function that returns a pointer-of-arrays to the calling function. */
#include <stdio.h>
int *pfunc(void);
|
by: ZMan |
last post by:
The following code won't compile with gcc version 3.4.2
(mingw-special).
How come?
Error: cannot convert `char (*)' to `char**'
/**********************************************************/
#include <cstdio>
#define MAX_WORD_LEN 80
#define MAX_SIZE 1000
|
by: Jess |
last post by:
Hello,
I understand that if an array is illegal in some particular context,
then its name will be converted to a pointer. For example, if
int a = {1,2,3};
then a function
void f(int* a);
|
by: vippstar |
last post by:
The subject might be misleading.
Regardless, is this code valid:
#include <stdio.h>
void f(double *p, size_t size) { while(size--) printf("%f\n", *p++); }
int main(void) {
double array = { { 3.14 }, { 42.6 } };
f((double *)array, sizeof array / sizeof **array);
return 0;
|
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...
|
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,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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...
|
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...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |