CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    May 2010
    Posts
    6

    VB.net control array setuo problem

    Hi, I need to unfortunately take up some of your valuable time. My brothers and I are trying to use Visual Sutudio 2008 -VB.net with Access 2007 to write a small program to help with managing our family business. It is to track the movement of machines and machine tools from various sites to other sites. I have a question in the Database forum but no one has had time to resond to it yet, so I wait maybe for answer to come, yes.

    I have some experience with VB6 and it was easy to do a control array for radio buttons such that btnSMP(0) and btnSMP(1) and btnSMP(2) were together and if user clicked on btnSMP(1) it was shown with the blck dot on it as selected. If one then changed mind (which seems to be a very common thing) then if user clicked on btnSMP(0) then it was selected and the other one was not.

    That is not possible in Visual Studio 2008 for what ever reason the higher ups decided. I have read a number of articles now in MSDN about how to duplicate that feature in VB.net code but it seems to be a lot of work and they add in many features I do not have a need of.

    Our problem is that we have on our form 35 items all of which need a button to select one of 3 grades: btnSMP(0)-GOOD and btnSMP(1) -USED and btnSMP(2)- JUNK.

    As the moderator says to make sure that I ask a question than here it is:

    According to the MSDN article:
    http://msdn.microsoft.com/en-us/libr...00(VS.71).aspx
    do we have to create 35 separate ButtonArray classes one for each of the types of material being graded?

    I am not wishing to add, or remove buttons just when every one of the possible 35 types of materials is being graded that the user can select or deselct and select another grade. On any one form the user may select from 1 to all 35 types of materials to grade, but often more than not the average is 10 - 13 items.

    Certainly is an easier way available? Please show me another article than from what I am finding in MSDN or on google with "VB.net control array" Many many of them to read through to find maybe what it is I am in need of.

    Thank you in ahead of time for your response

    Asad

  2. #2
    Join Date
    May 2010
    Posts
    6

    VB.net control array setup problem

    Hi, I need to unfortunately take up some of your valuable time. My brothers and I are trying to use Visual Sutudio 2008 -VB.net with Access 2007 to write a small program to help with managing our family business. It is to track the movement of machines and machine tools from various sites to other sites. I have a question in the Database forum but no one has had time to resond to it yet, so I wait maybe for answer to come, yes.

    I have some experience with VB6 and it was easy to do a control array for radio buttons such that btnSMP(0) and btnSMP(1) and btnSMP(2) were together and if user clicked on btnSMP(1) it was shown with the blck dot on it as selected. If one then changed mind (which seems to be a very common thing) then if user clicked on btnSMP(0) then it was selected and the other one was not.

    That is not possible in Visual Studio 2008 for what ever reason the higher ups decided. I have read a number of articles now in MSDN about how to duplicate that feature in VB.net code but it seems to be a lot of work and they add in many features I do not have a need of.

    Our problem is that we have on our form 35 items all of which need a button to select one of 3 grades: btnSMP(0)-GOOD and btnSMP(1) -USED and btnSMP(2)- JUNK.

    As the moderator says to make sure that I ask a question than here it is:

    According to the MSDN article:
    http://msdn.microsoft.com/en-us/libr...00(VS.71).aspx
    do we have to create 35 separate ButtonArray classes one for each of the types of material being graded?

    I am not wishing to add, or remove buttons just when every one of the possible 35 types of materials is being graded that the user can select or deselct and select another grade. On any one form the user may select from 1 to all 35 types of materials to grade, but often more than not the average is 10 - 13 items.

    Certainly is an easier way available? Please show me another article than from what I am finding in MSDN or on google with "VB.net control array" Many many of them to read through to find maybe what it is I am in need of.

    Thank you in ahead of time for your response

    Asad

  3. #3
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: VB.net control array setup problem

    Do you really even need a control array to do this?

    If I am not mistaken radio buttons are normally grouped within a frame or other containter and only one can be selected at a time within that container. Control array allows you to code it a bit differently but you should be able to get the result you need without an array.
    Always use [code][/code] tags when posting code.

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: VB.net control array setup problem

    If not, just CREATE a Frame around the buttons that have only one sensible option. The Frame will only let one be selected.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: VB.net control array setuo problem

    Hello.

    Do all 35 items have the same values to be selected?

    For example. You have 35 different items. But all 35 things have a setting of either of these :

    btnSMP(0)-GOOD and btnSMP(1) -USED and btnSMP(2)- JUNK.

    ?

    If it is so, there is indeed an easier way

  6. #6
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: VB.net control array setuo problem

    [ Merged ]

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

Featured