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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:43:48+00:00 2026-05-12T06:43:48+00:00

Sorry for asking an complete n00b question, but I’ve tried everything I can think

  • 0

Sorry for asking an complete n00b question, but I’ve tried everything I can think of and nothing has worked.

Google hasn’t been too useful, all the results are from ancient versions of Silverlight 🙁

The problem:

I’ve got an Silverlight User Control. The layout root is an Grid. The grid is defined so:

<Grid.ColumnDefinitions>
    <ColumnDefinition Width="30" />
    <ColumnDefinition Width="*" />
    <ColumnDefinition Width="30" />
</Grid.ColumnDefinitions>

<Grid.RowDefinitions>
    <RowDefinition Height="*" />
</Grid.RowDefinitions>

<MyScrollButton Grid.Column="0" Name="LeftScroller" Width="30" Height="Auto" />

<ListBox x:Name="ScrollBox" Grid.Column="1"  RenderTransformOrigin="0.5, 0.5"
         ScrollViewer.HorizontalScrollBarVisibility="Hidden" 
         ItemContainerStyle="{Binding Source={StaticResource ListBoxItemStyle}}"
         ItemsSource="{Binding Source={StaticResource ControlState:myItemSource}}"
         Style="{Binding Source={StaticResource ListBoxStyle}}"
         HorizontalAlignment="Center"
         BorderThickness="0" Width="Auto" Height="796">

    <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
            <StackPanel Orientation="Horizontal"/>
        </ItemsPanelTemplate>
    </ListBox.ItemsPanel>

</ListBox>

<MyScrollButton Grid.Column="2" Width="30" Height="Auto"/>

When I run this, LayoutRoot resizes correctly. It fills the browser window.

However, the child controls aren’t (re)sized. MyScrollButtons and ListBox don’t obtain any height, so they’re not visible.

I want these controls to inherit their height from the parent. They should be 100% of the height of the page.

I’ve tried:

  1. Entering percentages in heights. Invalid.
  2. Binding height to LayoutRoot’s height with help from Blend 3. Makes no difference.
  3. Entering * as the height. Invalid.

For the ‘record’ implementing the same functionality in Flex is (was, I’m doing this as an comparison of the two techs) really easy..

  • 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-12T06:43:48+00:00Added an answer on May 12, 2026 at 6:43 am

    I don’t have Silverlight 3 installed so I did this in 2. I also don’t have the “MyScrollButton” control to test with. But this code worked for me:

    <UserControl
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        x:Class="RegexHero.UserControl1"
        d:DesignWidth="640" d:DesignHeight="480">
    
        <Grid x:Name="LayoutRoot">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="30" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="30" />
        </Grid.ColumnDefinitions>
    
        <Grid.RowDefinitions>
                <RowDefinition Height="*" />
        </Grid.RowDefinitions>
    
    
        <ListBox x:Name="ScrollBox" Grid.Column="1"  RenderTransformOrigin="0.5, 0.5"
                         ScrollViewer.HorizontalScrollBarVisibility="Hidden" 
                         ItemContainerStyle="{Binding Source={StaticResource ListBoxItemStyle}}"
                         ItemsSource="{Binding Source={StaticResource ControlState:myItemSource}}"
                         Style="{Binding Source={StaticResource ListBoxStyle}}"
                         HorizontalAlignment="Center"
                         BorderThickness="0" Width="Auto" Height="Auto" VerticalAlignment="Stretch">
    
                <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                                <StackPanel Orientation="Horizontal"/>
                        </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
    
        </ListBox>
    
    
        </Grid>
    </UserControl>
    

    The ListBox fills the height of the screen. I’d hope it’d be the same in Silverlight 3.

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

Sidebar

Related Questions

Sorry asking so many questions but believe me.. I tried Google first. :) When
Sorry for asking such a general question but this has been bugging me for
Sorry for asking this question, but I searched all Java-related questions, but I got
Sorry for asking a basic question like this but I've been reading on this
Sorry for asking a question about something I don't know much about, but I've
sorry for asking this question again but i didnt get much help on the
Hello yeah I'm asking this question a second time, sorry about that but I
sorry for re-asking, but i have new circumstances. here was my question .net -
Sorry for asking a question so similar to the last install4j question, but I
Yeah, sorry about asking a stupid n00b question. So I have a C# program.

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.