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

  • Home
  • SEARCH
  • 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 8802041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:59:13+00:00 2026-06-14T00:59:13+00:00

How do you center align the items of a Listbox using C# in Windows

  • 0

How do you center align the items of a Listbox using C# in Windows 8?

Here is my xaml:

        <ListBox x:Name="listBox1" HorizontalAlignment="Left" Height="365" Margin="242,275,-1,0" VerticalAlignment="Top" Width="190" SelectionChanged="listBox1_SelectionChanged" FontSize="20" FontWeight="Bold"/>

And in the code behind, I populate the listbox with the following code:

  listBox1.Items.Add(new ListBoxItem() { Content = Global.availableDecks[0].ToString(), IsEnabled = true });
  listBox1.Items.Add(new ListBoxItem() { Content = Global.availableDecks[1].ToString(), IsEnabled = true });
  • 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-06-14T00:59:14+00:00Added an answer on June 14, 2026 at 12:59 am

    Try creating a ItemTemplate to create visual representations of your object (list box items in this case). You can find more information here

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

Sidebar

Related Questions

<td align=left valign=top bgcolor=#FFFFFF class=rows style=text-align:center;><input name=activeloyalty type=checkbox value=24></td> <td align=left valign=top bgcolor=#FFFFFF class=rows
How can I center align (horizontally) an image inside its container div? Here's the
I have the following CSS and HTML: .TestPadding{ width:29px; text-align:center; height:18px; padding:3px 0px 2px
I'd like to center a list of left-aligned items. This is what I currently
How do I center list items inside a ul without using extra divs or
I'm try to change text color and align item in spinner to center of
I am trying to center align my google chart but have been unsuccessful in
How do I center align the image to vertically and horizontally to the div.
To vertically-center align text in a table-cell, I use vertical-align: middle in the td
1) If inside CSS file we specify the following style: td { text-align:center; }

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.