Results 1 to 14 of 14

Thread: [RESOLVED] Control Arrays VB.NET Compact Framework

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2006
    Posts
    61

    Resolved [RESOLVED] Control Arrays VB.NET Compact Framework

    Hi there!
    I am checking out to find a way to have (simulate?) control arrays (command buttons specificaly) in VB.NET COMPACT Framework.
    All solutions that i find say to use the TabIndex or the Tag property. But that only exists in VB.net and not for the Compact Framework. When programming for a PDA, i dont see that property at the command button properties window.
    Any ideas on how to have control arrays in vb.net framework??
    Thanks
    Last edited by sarris; Oct 27th, 2006 at 03:26 PM.

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Control Arrays VB.NET Compact Framework

    you can make your own array of whatever type (buttons for example) and put all your buttons in that array. Controls are reference types, so you aren't creating MORE controls by doing this, you are simply creating variables that point to the same objects that are on the form.

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2006
    Posts
    61

    Re: Control Arrays VB.NET Compact Framework

    i see
    and how can i do that? create and empty array and add objects one by one?? if so, how do i add odjects to the array?
    Thanks

  4. #4
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Control Arrays VB.NET Compact Framework

    Are you using VB.NET 2003 or 2005? I have a control array example project in 2003 if you use that. Its a regular winforms app, but I don't think it does anything that isn't available in the CF.

  5. #5

    Thread Starter
    Member
    Join Date
    Jun 2006
    Posts
    61

    Re: Control Arrays VB.NET Compact Framework

    2003
    It would be really helpfull i you could send that. Thank you very much for so fast replies.

  6. #6
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Control Arrays VB.NET Compact Framework

    here I had made it for someone with a similar question. You can find the DL here

    http://www.vbforums.com/showthread.p...=control+array

  7. #7

    Thread Starter
    Member
    Join Date
    Jun 2006
    Posts
    61

    Re: Control Arrays VB.NET Compact Framework

    I will check it out now. Thank you very much again.

  8. #8

    Thread Starter
    Member
    Join Date
    Jun 2006
    Posts
    61

    Re: Control Arrays VB.NET Compact Framework

    The example you sent me uses tabindex. I dont have that on the compact framework for the command buttons.
    Or isnt it necessary??

  9. #9
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Control Arrays VB.NET Compact Framework

    What are you doing with control arrays in the CF? What's the purpose?
    My usual boring signature: Nothing

  10. #10

    Thread Starter
    Member
    Join Date
    Jun 2006
    Posts
    61

    Re: Control Arrays VB.NET Compact Framework

    I have 10 command buttons. I want whenever you click one of those, a single event to be called and only diference should be the index number(an integer) of the button clicked.

  11. #11
    Frenzied Member stimbo's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,739

    Re: Control Arrays VB.NET Compact Framework

    I could be completely wrong but I don't think you can get index numbers as you want them in .NET.

    You could assign integer values to the Tag property instead and use that as your index value. Just a suggestion.
    Stim

    Free VB.NET Book Chapter
    Visual Basic 2005 Cookbook Sample Chapter

  12. #12

    Thread Starter
    Member
    Join Date
    Jun 2006
    Posts
    61

    Re: Control Arrays VB.NET Compact Framework

    Thanks but i am reminding again that tag properties are not available on the command buttons of the compact framework

  13. #13
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Control Arrays VB.NET Compact Framework

    My code doesn't use tabindexes???

    Where did you see that?

    My code simply creates an array at runtime of the specific textboxes I want in the array, and then loops them.

    I tested it on the CF and it works fine.

  14. #14

    Thread Starter
    Member
    Join Date
    Jun 2006
    Posts
    61

    Re: Control Arrays VB.NET Compact Framework

    True and its really helpfull.Thanks!!
    Works super fine like this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width