Skip to main content

Microsoft Silverlight

Unanswered Question Resolution independent designingRSS Feed

(0)

rajuunni
rajuunni

Member

Member

0 points

1 Posts

Resolution independent designing

Hi all, 

We have a requirement to design our screens without providing the width and height.

Following is the scenario :

<basics:ChildWindow ....

Title="ChildWindow2" mc:Ignorable="d" d:DesignWidth="200" d:DesignHeight="100" HorizontalAlignment="Center" VerticalAlignment="Center" MinHeight="200" MinWidth="300" >
 <Grid x:Name="LayoutRoot" Background="White">
  <Grid.RowDefinitions>
   <RowDefinition />
   <RowDefinition Height="Auto"  />
  </Grid.RowDefinitions>
        <TextBlock TextWrapping="Wrap" LineStackingStrategy="BlockLineHeight" />
        <TextBox Margin="0,3,0,46" TextWrapping="Wrap"  />
    </Grid>

...

Here the problem is that initially the window opens in the design time width and height. But when we start typing in to the textbox, instead of wrapping and displaying a scroll, it stretches and the window stretches along with it.

We need to achieve this without providing any height and width attributes.

Please advice..

swo
swo

Contributor

Contributor

2149 points

341 Posts

Re: Resolution independent designing

Hi

Try

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

 Than you get 2 Coloms where the second is the double from the first. Put your TextBoy to one of this coloms.

 

If this has answered your question, please click on "mark as answer" on this post. Thank you!

Wolfgang (SWO) - www.EasyByte.at


bharathkumars87
bharathk...

Member

Member

280 points

51 Posts

Re: Resolution independent designing

 hai raju

    Try this,

<basics:ChildWindow ....

Title="ChildWindow2" mc:Ignorable="d" d:DesignWidth="200" d:DesignHeight="100" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinHeight="200" MinWidth="300" >
 <Grid x:Name="LayoutRoot" Background="White">
  <Grid.RowDefinitions>
  <RowDefinition Height="*" />
   <RowDefinition Height="Auto"  />
  </Grid.RowDefinitions>
        <TextBlock TextWrapping="Wrap" LineStackingStrategy="BlockLineHeight" />
        <TextBox Margin="0,3,0,46" TextWrapping="Wrap"  />
    </Grid>

 

 

bharath kumar.s
Please "Mark as Answer" if this post answered your question. :)
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities