CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2000
    Location
    Indianapolis
    Posts
    6,754

    Array of Controls with Xaml

    I've not done much with Xaml, but am using it for a Win8 app I'm building. In a WinForm app, I can easily create an array of controls that I can display. Is there a way to create an array of controls in Xaml? The array makes it much easier to manipulate the controls in looks versus drawing individual controls.

    For example, if I wanted to create a 4x4 grid of buttons in an array in a Win8 App, what would be the best approach? Anyone have any sample code of something like this?

    Thanks,

    Brad!

  2. #2
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: Array of Controls with Xaml

    In XAML, it's best to do the layouting using one of the layouting controls, such as a Grid, StackPanel, and so on.
    So, for a 4x4 grid, you should use the Grid panel.
    You can probably (never tried it though) change the number of columns/rows of your Grid control at runtime and insert new controls at runtime.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  3. #3
    Join Date
    May 2013
    Posts
    12

    Re: Array of Controls with Xaml

    How to use array in Java

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