Control Arrays in VB.NET - Page 3


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 3 of 19 FirstFirst 1234513 ... LastLast
Results 31 to 45 of 278

Thread: Control Arrays in VB.NET

  1. #31
    Jacob Grass Guest

    Re: Control Arrays in VB.NET

    > The Delphi version is very underpowered.
    >
    > MM


    What?!?!? A negative word about Delphi?!?!? From you?!?!?!

    Be still my beating heart

    Jacob



  2. #32
    Patrick Troughton Guest

    Re: Control Arrays in VB.NET


    Sounds like a great opportunity to show beginners a simple, real world example
    of using inheritance, don't you think, Karl "I didn't think of that" Peterson?
    <g>

    /Pat

    "Karl E. Peterson" <karl@mvps.org> wrote:
    >As to "Pull yer head out, Pat!"'s contention that this "isn't needed", of

    course it's
    >not. It's a convenience for folks just starting out. It significantly

    lowers the
    >"cost of entry". But then, maybe this isn't a langauge for beginners anymore.

    Is
    >it?



  3. #33
    Joe \Nuke Me Xemu\ Foster Guest

    Re: Control Arrays in VB.NET

    "Mike Mitchell" <kylix_is@hotmail.com> wrote in message <news:3ab7d157.7216376@news.freeuk.com>...

    > My one enhancement request for VB6 tags, since apparently Microsoft
    > will be supporting the product indefinitely, is to make the tag
    > property a variant, and then I could store an array in it as well as
    > keeping its simple string approach for those who need only that.


    Why? Just use the Tag string as a key for a Collection or Dictionary.

    --
    Joe Foster <mailto:jfoster@ricochet.net> Greed = God? <http://www.xenu.net/>
    WARNING: I cannot be held responsible for the above They're coming to
    because my cats have apparently learned to type. take me away, ha ha!



  4. #34
    Larry Serflaten Guest

    Re: Control Arrays in VB.NET


    "Karl E. Peterson" <karl@mvps.org> wrote

    But then, maybe this isn't a langauge for beginners anymore. Is
    > it?
    >


    No, I would say not. Everyone involved has to learn the CLR classes
    that pack the functionality they need. I would also think a beginner would
    need a less complicated IDE. Perhaps someone will break open that
    can of dogfood, creating a beginner's VB.Net IDE, from VB.Net....

    ???
    LFS





  5. #35
    Ian Lowe Guest

    Re: Control Arrays in VB.NET

    Hi,

    > Tag? Ugh. If you need to add an additional property to an existing

    control,
    > there's already a better way to do it....inheritance. Hopefully, they'll
    > reconsider this one. <snip>


    Instead of MS adding a Tag property to all controls, how about a Tag Control
    that adds a Tag property to all controls on a form, like the Tool Tip
    component? I don't know how the ToolTip and HelpProvider components are
    implemented, so maybe this isn't the best solution? Any details on the
    implementation that might block this, anyone?

    After all, I'd hate for the VB team to need to create a seperate VBControl
    inheritence heirarchy to implement this one property.

    Ian.



  6. #36
    Jonathan Allen Guest

    Re: Control Arrays in VB.NET

    > I would also think a beginner would
    > need a less complicated IDE.


    I have to agree with that sediment. The VS IDE is rather intimidating.

    --
    Jonathan Allen


    "Larry Serflaten" <serflaten@usinternet.com> wrote in message
    news:3ab83683@news.devx.com...
    >
    > "Karl E. Peterson" <karl@mvps.org> wrote
    >
    > But then, maybe this isn't a langauge for beginners anymore. Is
    > > it?
    > >

    >
    > No, I would say not. Everyone involved has to learn the CLR classes
    > that pack the functionality they need. I would also think a beginner

    would
    > need a less complicated IDE. Perhaps someone will break open that
    > can of dogfood, creating a beginner's VB.Net IDE, from VB.Net....
    >
    > ???
    > LFS
    >
    >
    >
    >




  7. #37
    Gary Nelson Guest

    Re: Control Arrays in VB.NET

    > Control arrays aren't really needed in .NET, or at least they're not as
    useful
    > as they used to be. First, VB supports delegates so you can assign the

    same
    > event procedure to multiple controls without using a control array.

    Second,
    > if you want to loop controls, you can assign each control to a collection
    > and just iterate on that.


    Ok, Pat, tell me how to do the following:

    I have a routine that creates forms dynamically. The base form has a
    command button, a list control, a text box, and option button, and a
    checkbox. I have code that tells how many of each is needed, loads them at
    run time and places them where I want on the form. I just checked one of my
    programs and one form is reused 99 times (from 99 different places in the
    program) using this method. How is this done in NET?

    Gary



  8. #38
    Gary Nelson Guest

    Re: Control Arrays in VB.NET

    Matthew,


    > Third, under WinForms it is easy to add controls at run-time (the other

    main use
    > of control arrays).


    Would you like to explain that? And what naming convention is used? If I
    need 15 copies of a control, how do I create the 15 different names, or is
    it expected to be done by hand?

    Gary



  9. #39
    Gary Nelson Guest

    Re: Control Arrays in VB.NET

    Pat,

    Obviously you haven't been in programming for long enough to understand what
    it is all about.

    Having ported from CP/M to gwbasic to QB2 to QB3 to QB4 to QB4.5 to MB6 to
    MB7.0 to MB7.1 to VB1 to VB2 to VB3 to VB4 to VB5 to VB6, I can only agree
    too much with Dan's words:


    "The *SAME* thing will occur with what you hail as wondrous improvements in
    vb.net. One day *your* wonder-language will get trashed along with all the
    code you wright between now and then."


    When that happens, and only then, will you understand what we are angry
    about.

    Gary





  10. #40
    Jonathan Allen Guest

    Re: Control Arrays in VB.NET

    > And what naming convention is used?

    Name them all Bob. It is a nice friendly name.

    > ? If I
    > need 15 copies of a control, how do I create the 15 different names, or is
    > it expected to be done by hand?


    Control.Name has never had much meaning, and in VB.Net it has none at all.
    Don't confuse it with the variable name. You code will look something like
    this...

    Public Sub BSCodeThatDoesNotActuallyWork(...) Handles cmdAddCheckbox.Click

    Dim myControl As New CheckBox

    myControl.Name = "Bob"
    Me.AddControl myControl

    AddHandler (myControl, AddressOf( MyClickEvent ) )
    AddHandler (myControl, AddressOf( MyMouseOverEvent ) )

    myCollection.Add myControl

    Dim sMessage = ("I now have " & myCollection.Count & " checkboxes"
    MessageBox.Show (sMessage )

    End Sub

    --
    Jonathan Allen


    "Gary Nelson" <gn@contanet.es> wrote in message
    news:3ab87726@news.devx.com...
    > Matthew,
    >
    >
    > > Third, under WinForms it is easy to add controls at run-time (the other

    > main use
    > > of control arrays).

    >
    > Would you like to explain that? And what naming convention is used? If I
    > need 15 copies of a control, how do I create the 15 different names, or is
    > it expected to be done by hand?
    >
    > Gary
    >
    >




  11. #41
    Patrick Troughton Guest

    Re: Control Arrays in VB.NET


    Gary,

    I enjoy intellectual discussions, not emotional ones. Against my better judgement,
    I'll try to respond anyway....

    >Obviously you haven't been in programming for long enough to understand

    what
    >it is all about.


    You don't know me or anything about me. You cannot justifiably make such
    a sweeping assumption.

    >Having ported from CP/M to gwbasic to QB2 to QB3 to QB4 to QB4.5 to MB6

    to
    >MB7.0 to MB7.1 to VB1 to VB2 to VB3 to VB4 to VB5 to VB6,


    I have ported *dozens* of programs from one platform to another. Porting
    Windows programs to .NET will be nothing new or unexpected.

    > I can only agree
    >too much with Dan's words:
    >"The *SAME* thing will occur with what you hail as wondrous improvements

    in
    >vb.net. One day *your* wonder-language will get trashed along with all

    the
    >code you wright between now and then."


    Well, of course! I completely agree with that statement. Does that surprise
    you? It shouldn't. Every 5-10 years the IT industry experiences a watershed
    event that requires that you throw out your old tools and technologies and
    replace them with new ones. For PCs, this last happened 6 years ago when
    we went from 16-bit Windows to 32-bit Windows. Before that, it was the change
    from DOS to Windows. We are now at yet another watershed event - the change
    from Windows to .NET. As I said, this is nothing new and nothing unexpected.
    And yes, in another 5-10 years, .NET will be replaced. And 5-10 years after
    that, .NET's replacement will be replaced. Etc. This is nothing new and nothing
    unexpected.

    >When that happens, and only then, will you understand what we are angry
    >about.


    That's one of your problems. You're letting anger cloud your judgement.

    /Pat



  12. #42
    Patrick Steele Guest

    Re: Control Arrays in VB.NET

    In article <3ab876b1@news.devx.com> (from Gary Nelson <gn@contanet.es>),
    > Ok, Pat, tell me how to do the following:


    I know you meant a different Pat, but I'll jump in here.

    > I have a routine that creates forms dynamically. The base form has a
    > command button, a list control, a text box, and option button, and a
    > checkbox. I have code that tells how many of each is needed, loads them at
    > run time and places them where I want on the form. I just checked one of my
    > programs and one form is reused 99 times (from 99 different places in the
    > program) using this method. How is this done in NET?


    If I understand correctly, this one is very easy in .NET. Basically,
    create a class that inherits from System.WinForms.Form. This one can be
    used as your "base" form. Create a few methods that accept numbers for
    command buttons, checkboxes, etc. Here's some sloppy pseudo-code:

    public function MakeCmdButtons(ByVal Cnt As Integer)
    dim x as integer
    dim newbutton as Button

    for x = 1 to Cnt
    newbutton = new Button
    newbutton.Visisble = true
    . ' set the rest of the inital properties

  13. #43
    Craig Clearman Guest

    Re: Control Arrays in VB.NET

    Rob,

    >As many are pointing out, there are definitely ways to accomplish these things
    >in .NET.


    Yes, there are. I have no doubt about that. The point of my post was
    it will be *harder* in Visual Fred to accomplish the same
    functionality that control arrays gave us.

    Yes, you can do it. No, it is no longer as simple or intuitive.

    >However, inheritance aside, I would love it if MS would make the controls
    >implement ICloneable, which would do a memberwise clone minus memebers like
    >handle.


    It has been intimated that cloning will be available in Version 2.

    Ciao, Craig


  14. #44
    Patrick Troughton Guest

    Re: Control Arrays in VB.NET


    Dan Barclay <dbarclay@ih2000.net> wrote:
    >Just because I don't use it should I be so
    >arrogant as to think it should be removed?


    That has absolutely nothing to do with it. (Did you actually *read* my post?)

    /Pat

  15. #45
    Rob Teixeira Guest

    Re: Control Arrays in VB.NET


    I wonder if it's because we're so used to the traditonal VB IDE?
    I mean, I've used other languages and the first couple of weeks are like
    walking around blind. You eventually get used to it though. I think a lot
    of IDE's are intimidating until you get used to them.

    -Rob

    "Jonathan Allen" <greywolf@cts.com> wrote:
    >> I would also think a beginner would
    >> need a less complicated IDE.

    >
    >I have to agree with that sediment. The VS IDE is rather intimidating.
    >
    >--
    >Jonathan Allen
    >
    >
    >"Larry Serflaten" <serflaten@usinternet.com> wrote in message
    >news:3ab83683@news.devx.com...
    >>
    >> "Karl E. Peterson" <karl@mvps.org> wrote
    >>
    >> But then, maybe this isn't a langauge for beginners anymore. Is
    >> > it?
    >> >

    >>
    >> No, I would say not. Everyone involved has to learn the CLR classes
    >> that pack the functionality they need. I would also think a beginner

    >would
    >> need a less complicated IDE. Perhaps someone will break open that
    >> can of dogfood, creating a beginner's VB.Net IDE, from VB.Net....
    >>
    >> ???
    >> LFS
    >>
    >>
    >>
    >>

    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center