CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2000

    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?



  2. #2
    Join Date
    Nov 2003

    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 (
    My Blog
    Wallpaper Cycler

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

  3. #3
    Join Date
    May 2013

    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