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 138151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:13:07+00:00 2026-05-11T07:13:07+00:00

Say I have a grid with 3 rows. In the center row I’d like

  • 0

Say I have a grid with 3 rows. In the center row I’d like to put an image and then center it in that row vertically and horizontally. But since (I think) Silverlight uses upper left corners of an element when it centers, the upper left corner of the image is centered when I tell it to center vertically/horizontally.

I’ve seen 2 approaches to this:

  • modify the image position in an event
  • set the image’s margin to a very large number on all sides (500)

Is there an easier way? Seems kinda weird that you’d need to do something hacky like those 2 approaches. I’d prefer to just tell the thing that its anchor is in the center and then tell it to center. Hmmm, could be a good custom control.

Update: the really obnoxious thing about this was when I made a minor change to the page to change how that image was centered and FF3 displayed an old version of the page. Which made me think that it didn’t work. Then I pulled it up in IE and it looked right. I flushed FF3’s cache and it displayed the right page. Damn annoying.

  • 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. 2026-05-11T07:13:08+00:00Added an answer on May 11, 2026 at 7:13 am

    Why wouldn’t this work for you?

    <Grid x:Name='LayoutRoot' Background='White'>     <Grid.RowDefinitions>         <RowDefinition />         <RowDefinition />         <RowDefinition />     </Grid.RowDefinitions>     <Grid.ColumnDefinitions>         <ColumnDefinition />         <ColumnDefinition />         <ColumnDefinition />     </Grid.ColumnDefinitions>     <Image Source='Butterfly.jpg'            Height='50' Width='50'            HorizontalAlignment='Center' VerticalAlignment='Center'            Stretch='UniformToFill'            Grid.Column='1' Grid.Row='1' /> </Grid> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have some grid that looks like this _ _ _ _
Say I have a very simple WPF grid (6 rows x 6 columns) defined
Say I have a Telerik MVC Grid, AJAX bound and I want to put
I have editable grid view, If I click on edit in any row say
Say that you have a grid where users draw pictures/shapes by clicking and coloring
Some info of the situation: Say I have a grid view of 10 rows
In my window, I have a grid with two rows. In the first row
Say I have some grid that you need to scroll down to see all
Let's say I have ten rows on a data grid and I have changed
BACKGROUND: I have a grid of 36 buttons, lets say a 6 rows &

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.