Results 1 to 6 of 6

Thread: [2008] NOt sure how to do this... grouping controls?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2007
    Posts
    180

    [2008] NOt sure how to do this... grouping controls?

    I'm building an app that list information. It will have list of each object going vertically, with the information about the object going horz across that line. My issue is I need to scroll through these lines, however each line will contain text, images, scroll bar, button, etc. Just common control items.

    I first started off grouping them in a panel (panel being everything needed in that one line of information). I was thinking I could spawn more identical panels, one for each object listed. I also tried this using a UserControl (not sure if this is the right thing to do).

    I just need a simple panel or area that I can layout my controls as need, then create identical panels as needed for each line. Then I can just scroll through then using some script to mod there location.

    What is the best way to go about doing this? Panel? UserControl? I've tried the usercontrol, however I coudlnt get it to show on the form.

    What do you suggest?

    Dave

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

    Re: [2008] NOt sure how to do this... grouping controls?

    Take a look at the windows repeater control. I'm not sure whether it is available in 2008, or if you still need to get the VB PowerPacks from MS for this, but it might do what you need. Might not, too, as I have never used it, myself.
    My usual boring signature: Nothing

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2008] NOt sure how to do this... grouping controls?

    Quote Originally Posted by Shaggy Hiker
    Take a look at the windows repeater control. I'm not sure whether it is available in 2008, or if you still need to get the VB PowerPacks from MS for this, but it might do what you need. Might not, too, as I have never used it, myself.
    The DataRepeater control is part of the VB PowerPacks, which is installed by default with VS 2008 SP1. For VS 2008 RTM or VS 2005 you will need to download and install.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Feb 2007
    Posts
    180

    Re: [2008] NOt sure how to do this... grouping controls?

    But I remember doing this once before using user controls in VB6. I had an Image box, buttons, and a few labels. Now I dont remember for the life of me how I did it, nor how to do it in vb.net (using the express).

    So if I were to use Custom Controls, I need this repeater? I just can call a new user control to show up?

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

    Re: [2008] NOt sure how to do this... grouping controls?

    If the repeater control will do what you want, then you can add it like any other control, but you'd have to play around with it. Since the control didn't come out with the normal VS release, it hasn't gotten much talk.
    My usual boring signature: Nothing

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Feb 2007
    Posts
    180

    Re: [2008] NOt sure how to do this... grouping controls?

    I was able to get it working using an User Control. I was just calling it wrong.

    I was able to get it to work like this:
    (UserControl1 is the control I build including a button, label, and checkbox)
    Code:
            Dim k(10) As Control
            .
            .
            .
            For i = 1 To 10
                k(i) = New UserControl1
                Dim l As Point
                l.X = 100
                l.Y = 100 * i
                k(i).Location = l
                Controls.Add(k(i))
            Next
    Now the next thing I need to do is to figure out how to call the objects with-in the control (like knowing when a button in the control was presses, or modifying text within the control, etc.) If you know this will not work, please help me save some time by calling me an idiot

    Any takers?

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