Search Results

Search found 460 results on 19 pages for 'stackpanel'.

Page 1/19 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Silverlight 4: StackPanel doesn't resize, when content gets more narrow

    - by Aaginor
    I am using Silverlight 4 with Blend 4. I have a (horizontal) stackpanel that includes some TextBoxes and a Button. The stackpanel is set to stretch to the size that the content uses. The TextBoxes are on autosize too. When I add text to the Textboxes, the textbox size grows and the stackpanel grows too. So far so good. When I remove text from the textboxes, the textbox size shrinks (as excepted), but the stackpanel size doesn't. Is there any trick to make the stackpanel change size, when the content (textboxes) getting smaller? Thanks in advance, Frank Here is the XAML for the UserControl: <Grid x:Name="LayoutRoot"> <StackPanel x:Name="StackPanelBorder" Orientation="Horizontal"> <TextBox x:Name="TextBoxCharacteristicName" TextWrapping="Wrap" Text="Tex"> </TextBox> <TextBox x:Name="TextBoxSep" TextWrapping="Wrap" Text="=" IsReadOnly="True"> </TextBox> <Button x:Name="ButtonRemove" Content="-" Click="ButtonAddOrRemove_Click"> </Button> </StackPanel> </Grid>

    Read the article

  • Silverlight: Scrolling with a StackPanel

    - by programatique
    I have a grid, 3 by 3 (3 rowdefinitions and 3 columndefinitions). I want some content (a StackPanel) in one of those grid cells to scroll. I'm fairly sure this is possible but I cannot figure out how. I've tried adding ScrollViewers and Scrollbar controls to the grid cell I want to scroll, but this usually ends up creating scrolling for the entire page. Edit: My issue is more specificlly how I can get scrolling over a StackPanel. An example if the issue I am having is here: <Grid x:Name="LayoutRoot"> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <Grid> <TextBlock FontSize="16">1,1</TextBlock> </Grid> <Grid Grid.Column="1"> <TextBlock FontSize="16">1,2</TextBlock> </Grid> <Grid Grid.Row="1"> <TextBlock FontSize="16">2,1</TextBlock> </Grid> <Grid Grid.Column="1" Grid.Row="1"> <StackPanel> <TextBlock>Title</TextBlock> <Grid> <ScrollViewer> <StackPanel> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> </StackPanel> </ScrollViewer> </Grid> </StackPanel> </Grid> </Grid>

    Read the article

  • Silverlight: stretching to remaining space in StackPanel

    - by crimson13
    I have a vertical StackPanel with two elements: a Button and a ListBox. How can I have the ListBox stretch to the remaining page height? <StackPanel Height="Auto" Width="Auto"> <Button Height="30" Width="100" Content="Get Content" x:Name="GetContent"/> <ListBox Height="Auto" Width="Auto" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/> </StackPanel> Note that I got this to work using a Grid: <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Button Width="100" Height="30" Content="Get Content" Click="OnGetContent" Grid.Row="0" Grid.Column="0"/> <data:DataGrid x:Name="MyContent" Margin="0,5" Grid.Row="1" Grid.Column="0"/> </Grid>

    Read the article

  • WPF ToolBar Separator shrinks to nothing when inside a StackPanel

    - by qntmfred
    Given the very simple wpf app <Window x:Class="Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="800"> <Grid> <ToolBar Height="50" > <MenuItem Header="Test1" /> <MenuItem Header="Test2" /> <StackPanel Orientation="Horizontal"> <Separator /> <MenuItem Header="Test3" /> <MenuItem Header="Test4" /> <MenuItem Header="Test5" /> </StackPanel> </ToolBar> </Grid> </Window> The Separator element shrinks to nothing. If I put the Separator just before the StackPanel begins, it will show up. Why does this happen? Is there a style setting that can be applied somewhere to avoid this?

    Read the article

  • Add Expansion Button to Stackpanel

    - by scientist
    I'd like to add Elements to a StackPanel (or Listbox / Listview if it would make that easier) and automatically add a Button (like "...") to indicate that there are more children than there is space for. Consider a calendar that has appointment items in each day. If there are more appointments than as much as can be displayed a button is displayed to go to a detailed view for that day. Can this be done automatically, or how do I calculate the positions of the stackpanel and its items. It's for windows store development in c#. Thanks in advance.

    Read the article

  • Stackpanel add item animation

    - by grzegorz_p
    Hello, I've been struggling a while with marquee-style image scrolling control. At a moment, I stuck up with templated ItemsControl: <Window.Resources> <DataTemplate x:Key="itemsTemplate"> <Image Source="{Binding AbsolutePath}"></Image> </DataTemplate> </Window.Resources> <ItemsControl ItemTemplate="{StaticResource itemsTemplate}" x:Name="ic" ItemsSource="{Binding ElementName=mainWindow, Path=DataItems}" VirtualizingStackPanel.IsVirtualizing="True"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel Orientation="Vertical" VerticalAlignment="Bottom" VirtualizingStackPanel.IsVirtualizing="True" > </VirtualizingStackPanel> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> </ItemsControl> ItemsControl is bound to ObservableCollection, so I can add items at runtime. As soon as item goes off-screen it's removed from ObservableCollection. The last thing to do is implementing custom item add behavior (smooth slide-in instead of insert-translateothers behavior). Shall I derive from StackPanel to achieve such effect or just perform DoubleAnimation on currently adding item? Any suggestions appreciated.

    Read the article

  • (VB.NET + WPF) Drag + Drop (to allow user sorting) of stackpanel elements within a Scrollviewer?

    - by Matt H.
    I have good model (I think!) for how to allow a user to drag an element in a stackpanel and reposition it to another location within the stackpanel. However, my Stackpanel is placed within a ScrollViewer, like this (generalized): <ScrollViewer> <StackPanel> ....First item ....Second item ....Third item ....Etc. </StackPanel> <ScrollViewer> Here is the problem, I wish to simulate the functionality of programs like word, where if I am dragging selected content (or an object) outside the viewable area, the window will scroll in the direction of the mouse to see more places to drop my nifty little object. ...i.e. If I move the mouse to the top of my ScrollViewer while dragging a stackpanel's contents, I want the scrollviewer to slowly move up so I can see more locations to drop my content. Any suggestions? If you can help me solve this, you will be a godsend!

    Read the article

  • Using StackPanel Silverlight Control

    The StackPanel control is a simple layout panel that arranges content into a single line that can be oriented horizontally or vertically (the default).The StackPanel control allow us to stack objects one on top of the other, or next to each other.

    Read the article

  • I can't set a border around my StackPanel. Any help?

    - by Sergio Tapia
    Here's my XAML code: <Window x:Class="CarFinder.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Search for cars in TuMomo" Height="480" Width="600"> <DockPanel Margin="8"> <Border CornerRadius="6" BorderBrush="Gray" Background="LightGray" BorderThickness="2" Padding="8"> <StackPanel Orientation="Horizontal" DockPanel.Dock="Top" Height="25"> <TextBlock FontSize="14" Padding="0 0 8 0"> Search: </TextBlock> <TextBox x:Name="txtSearchTerm" Width="400" /> <Image Source="/CarFinder;component/Images/Chrysanthemum.jpg" /> </StackPanel> </Border> <StackPanel Orientation="Horizontal" DockPanel.Dock="Top" Height="25"> </StackPanel> </DockPanel> </Window> The border is set around the entire window. And also, when I create another StackPanel it's added to the right of my previous StackPanel instead of being added under it. What's the reason for this?

    Read the article

  • How can a WPF StackPanel fill vertically from bottom to top?

    - by Stimul8d
    I need to be able to fill a stackpanel with buttons but the buttons must appear at the bottom of the stackpanel first and populate upwards. The buttons are created dynamically and there's an unknown number of them so visual hackery just won't work. I've tried experimenting with vertical alignments but to no avail. Thanks in advance.

    Read the article

  • StackPanel location changes at runtime

    - by Vinjamuri
    I have a ToolBar WPF control which has a Stackpanel docked to right. I use this toolbar control in 3 other WPF controls by adding in the XAML. When I verify in the XAML the Stackpanel location is same for all 3 controls. But when I run my application, for one of the 3 controls, the StackPanel in the ToolBar control shifts to left. <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" Name="stackButtons" > Any idea? Appreciate your help..

    Read the article

  • WPF layout with several fixed height parts and certain parts relative to window size

    - by Daniil Harik
    Hello, At moment my main layout consists of vertically oriented stack panel and it looks like this: Root StackPanel StackPanel - fixed Height 150 (horizontal orientation) StackPanel - relative Height must be behalf of free space left on screen (but at least 150 px). Used by Telerik GridView Control, if I don't specify Height or MaxHeight Telerik GridView Height becomes very large and does not fit my window. StackPanel - fixed Height 100 (horizontal orientation) StackPanel - relative Height must be half of free space left on screen (but at least 150 px). Used by Telerik GridView Control, if I don't specify Height or MaxHeight Telerik GridView Height becomes very large and does not fit my window. StackPanel - fixed Height 100 (horizontal orientation) The view must totally fit available screen size. The problem is that I don't understand how to make certain areas of my view resize depending on available screen size. Is there is easy way to solve it, or should I be binding to Window height property and doing math? Thank You very much!

    Read the article

  • StackPanel position

    - by John Espinosa
    How can I find the position of a StackPanel after it has been animated? I have a button which slides the stackpanel to the left. But if I want it to slide to the left again, the animation does not work.

    Read the article

  • StackPanel loded is not getting fired in.cs page

    - by prince23
    <sdk:DataGridTemplateColumn> <sdk:DataGridTemplateColumn.CellTemplate> <DataTemplate> <StackPanel Loaded ="SPImage_Loaded" Orientation="Horizontal" Background="Transparent" > <Button x:Name="myButton" Click="Btn_Click"> <Image x:Name="imgMarks" " Stretch="None"/> </Button> </StackPanel> </DataTemplate> </sdk:DataGridTemplateColumn.CellTemplate> </sdk:DataGridTemplateColumn> in .cs i have defined the event for stack panel private void SPImage_Loaded(object sender, RoutedEventArgs e) { try { var TargetMarks = sender as StackPanel; Image imgMarks= (Image)TargetScore.FindName("imgMarks"); Marks obj = (Marks )TargetMarks.DataContext; // here marks oject would be containg the details // here if marks.score object value is 1 then bind the image //else // dnt bind the image . that is logic i am trying to do. imgMarks.Source = new BitmapImage(new Uri("/Images/a1.png", UriKind.Relative)); } catch (Exception) { throw; } } any solution on this would be great. is there any better solution to achive this. plz help me out. thank you.

    Read the article

  • Binding Data to a TextBlock using Domain Data Source

    - by TFisher
    I have a map with hotspots for each state (done in Expression Blend). I capture each MouseEnter of the state (1 thru 50). I pass that into my Domain Data Source: Dim activebox As Path = TryCast(sender, Path) activebox.Fill = mouseOverColor Dim StateID As Integer = CInt(Right(activebox.Name, 2)) Dim _StateContext As New StateContext myDataGrid.ItemsSource = _StateContext.States _StateContext.Load(_StateContext.GetStateByStateIDQuery(StateID.Text)) The above works fine for a datagrid, listbox and even a dataform. But I created a popup with a stackpanel that has textblocks. popupStatesBox.DataContext = ?????????????? popupStatesBox.IsOpen = True 'popup does open but has no data -- popupStatesBox.xaml <Popup x:Name="popupStatsBox" Margin="8,35,0,8" DataContext="{Binding}" IsOpen="false" Width="268" HorizontalAlignment="Left"> <StackPanel x:Name="Layout" Background="Black"> <TextBlock x:Name="tbState" Text="{Binding StateName /> <TextBlock x:Name="tbAbbrev" Text="{Binding Abbreviation}" /> </StackPanel> </Popup> How do I get the textblocks to display the values from the _StateContext. StackPanel has DataContext but no ItemsSource. What am I missing?

    Read the article

  • WPF XAML: how to get StackPanel's children to fill maximum space downward?

    - by Edward Tanguay
    I simply want flowing text on the left, and a help box on the right. The help box should extend all the way to the bottom. If you take out the outer StackPanel below it works great. But for reasons of layout (I'm inserting UserControls dynamically) I need to have the wrapping StackPanel. How do I get the GroupBox to extend down to the bottom of the StackPanel, as you can see I've tried: VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" Height="Auto" XAML: <Window x:Class="TestDynamic033.Test3" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Test3" Height="300" Width="600"> <StackPanel VerticalAlignment="Stretch" Height="Auto"> <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="Auto" Margin="10"> <GroupBox DockPanel.Dock="Right" Header="Help" Width="100" Background="Beige" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" Height="Auto"> <TextBlock Text="This is the help that is available on the news screen." TextWrapping="Wrap" /> </GroupBox> <StackPanel DockPanel.Dock="Left" Margin="10" Width="Auto" HorizontalAlignment="Stretch"> <TextBlock Text="Here is the news that should wrap around." TextWrapping="Wrap"/> </StackPanel> </DockPanel> </StackPanel> </Window> Answer: Thanks Mark, using DockPanel instead of StackPanel cleared it up. In general, I find myself using DockPanel more and more now for WPF layouting, here's the fixed XAML: <Window x:Class="TestDynamic033.Test3" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Test3" Height="300" Width="600" MinWidth="500" MinHeight="200"> <DockPanel VerticalAlignment="Stretch" Height="Auto"> <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="Auto" MinWidth="400" Margin="10"> <GroupBox DockPanel.Dock="Right" Header="Help" Width="100" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" Height="Auto"> <Border CornerRadius="3" Background="Beige"> <TextBlock Text="This is the help that is available on the news screen." TextWrapping="Wrap" Padding="5"/> </Border> </GroupBox> <StackPanel DockPanel.Dock="Left" Margin="10" Width="Auto" HorizontalAlignment="Stretch"> <TextBlock Text="Here is the news that should wrap around." TextWrapping="Wrap"/> </StackPanel> </DockPanel> </DockPanel> </Window>

    Read the article

  • Why cant i add Orientation property to the style setter in WPF

    - by nihi_l_ist
    When i write something like this: <Style x:Key="panelS"> <Setter Property="Orientation" Value="Horizontal" /> <Setter Property="DockPanel.Dock" Value="Top" /> </Style> I get the error that says: Cannot resolve the Style Property 'Orientation'. Verify that the owning type is the Style's TargetType, or use Class.Property syntax to specify the Property. Sure i have a Dock panel with many Stackpanels in it so i want to move Stackpanel's properties to the style. But there is this error and i dont quite understand what it means and what is the workaround(..i'd wanted not to assign Orientation on every Stackpanel).

    Read the article

  • WPF: Why all the love for the Grid control?

    - by Eduardo Molteni
    Seen various examples of WPF applications I've seen the use of the Grid control for almost anything, even simplest things with only 1 column or row. Also, the WPF templates start with an empty grid. For me, using StackPanel or DockPanel is less verbose and are better for maintenance (think adding a row later and having to add +1 to all the other rows) Why is Grid better or what I am missing?

    Read the article

  • Hide TabControl buttons to manage stacked Panel controls

    - by Luca
    I need to handle multiple panels, containing variuous data masks. Each panel shall be visible using a TreeView control. At this time, I handle the panels visibility manually, by making the selected one visible and bring it on top. Actually this is not much confortable, especially in the UI designer, since when I add a brand new panel I have to resize every panel and then design it... A good solution would be using a TabControl, and each panel is contained in a TabPage. But I cannot find any way to hide the TabControl buttons, since I already have a TreeView for selecting items. Another solution would be an ipotethic "StackPanelControl", where the Panels are arranged using a stack, but I couldn't find it anywhere. What's the best solution to handle this kind of UI?

    Read the article

  • Hide TabControl buttons to manage multiple panels stacked

    - by Luca
    I need to handle multiple panels, containing variuous data masks. Each panel shall be visible using a TreeView control. At this time, I handle the panels visibility manually, by making the selected one visible and bring it on top. Actually this is not much confortable, especially in the UI designer, since when I add a brand new panel I have to resize every panel and then design it... A good solution would be using a TabControl, and each panel is contained in a TabPage. But I cannot find any way to hide the TabControl buttons, since I already have a TreeView for selecting items. Another solution would be an ipotethic "StackPanelControl", where the Panels are arranged using a stack, but I couldn't find it anywhere. What's the best solution to handle this kind of UI?

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >