Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6909837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:44:23+00:00 2026-05-27T08:44:23+00:00

Hi, Based on the image above, I would like to align the words Action,

  • 0

Category Image

Hi,

Based on the image above, I would like to align the words “Action”, “Adventure”, “Arcade” to left most and align it to appear same height as the blue right arrow

my code for this is created dynamically:

            Dim intRow As Integer
            Dim intColumn As Integer


            intRow = 0
            intColumn = 0
            Dim rd As RowDefinition

            For Each abc In ArrayOfItems

                Dim newButton As New Button
                newButton.MaxHeight = 35
                newButton.MaxWidth = 300
                newButton.Background = Brushes.Transparent
                newButton.BorderBrush = Brushes.Transparent
                newButton.Tag = abc.application_category_id

                Dim sp As New StackPanel

                sp.Orientation = Orientation.Horizontal
                sp.HorizontalAlignment = Windows.HorizontalAlignment.Left
                sp.VerticalAlignment = Windows.VerticalAlignment.Center

                Dim Image2 As New Image
                Dim src As New Uri("/Images/chevron_blue.png", UriKind.Relative)
                Dim img As New BitmapImage(src)

                Image2.Width = 10
                Image2.Height = 10
                Image2.HorizontalAlignment = Windows.HorizontalAlignment.Left
                Image2.VerticalAlignment = Windows.HorizontalAlignment.Left
                Image2.Source = img

                Dim LabelApp As New Label
                LabelApp.Content = abc.category_name
                LabelApp.FontWeight = FontWeights.Bold
                LabelApp.FontSize = 9
                LabelApp.MaxWidth = 270
                LabelApp.Foreground = Brushes.Black
                LabelApp.HorizontalContentAlignment = Windows.HorizontalAlignment.Left
                LabelApp.VerticalAlignment = Windows.HorizontalAlignment.Left

                sp.Children.Add(LabelApp)
                sp.Children.Add(Image2)

                newButton.Content = sp

                Grid.SetColumn(newButton, intColumn)
                Grid.SetRow(newButton, intRow)
                gridCategoryGames.Children.Add(newButton)


                intRow = intRow + 1

                rd = New RowDefinition With {.Height = GridLength.Auto}

                gridCategoryGames.RowDefinitions.Add(rd)
                gridCategoryGames.UpdateLayout()


            Next abc
        End If
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:44:23+00:00Added an answer on May 27, 2026 at 8:44 am

    Ouch, that is an ugly way to do it 🙂

    Fortunately WPF has something that will cut your code down substantially, the ItemsControl. As you already have ArrayOfItems which is obviously IEnumerable, you can craft you XAML like this:

        <ItemsControl ItemsSource="{Binding ArrayOfItems}" >
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Vertical" />
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate >
                    <StackPanel Orientation="Vertical" HorizontalAlignment="Right" >
                        <TextBlock Text="myText"/>
                        <Image Source="path to my image" />
                    </StackPanel>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    

    You can then get rid of all that code that is manually creating items. The controls specified in ItemsControl.ItemTemplate will be repeated for every item in your list. The sky is the limit with this approach (there are literally thousands of examples of how to use this control).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Based on the above coordinates in the above image, I'd like to be able
Using a Java based image uploader and having problems, seems my controller action is
Does anyone know how I would go about changing (transforming) an image based on
I have an Image file that I would like to crop and resize at
I'm using a whole bunch of CALayers, creating a tile-based image not unlike GoogleMaps
There are lots of non-image-based CAPTCHA ideas floating around. But what about the old-fashioned
I wish to draw an image based on computed pixel values, as a means
I've written a simple Java applet to generate a technical image based upon some
I am working on a view that selects an image (chart) based on user
I'm generating a coupon based on dynamic input and a cropped image, and I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.