Fazer uma PerguntaFazer uma Pergunta
 

RespondidoRemove the space over stack panel

  • sábado, 7 de novembro de 2009 8:22Rammohan Ammiti Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     

    Hi

     I am set the columns and rows  ..First  row i assing the stack panel with subelements that i set as Grod.row(0);
                 and another rows another stack panle with subelements are there that i set as a Gid.Row(1), it's working fine

    if i clikc the some button i need to collapsed first stackpanle and second stackpanlemove to first position.

    pls help put me

    Thanks
    Ram

Respostas

  • terça-feira, 10 de novembro de 2009 11:04Rammohan Ammiti Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     Respondido

    Hi william,


    I repro my application . i fixed it. throught

     

    public void Refrencestackremove()

    {

    ww.StackPanelTopBodyPanleCaptions.Height = 0;

     

    GridLength gl = new GridLength(0.0);

    ww.TopBodyPanel.RowDefinitions[0].Height = gl;

    }

    #endregion

     



    actually i used the grids under the stack panels that is why i used above function. it's working fine now.


    Thanks
    Ram

    • Marcado como RespostaRammohan Ammiti terça-feira, 10 de novembro de 2009 11:04
    •  

Todas as Respostas

  • sábado, 7 de novembro de 2009 8:29William Han - MSFT Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     Resposta Proposta

    Perhaps you can change the first stackpanel.Visibility to Collapsed as example below:

    Markup:
    <Window x:Class="GridPanelTest.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Window1" Height="300" Width="300">
        <StackPanel>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <StackPanel Name="firstPanel">
                    <TextBlock Text="First cell"/>
                </StackPanel>
                <StackPanel Grid.Row="1">
                    <TextBlock Text="Second cell"/>
                </StackPanel>
            </Grid>
            <Button Content="Test" Click="Button_Click"/>
        </StackPanel>
    </Window>


    Code:
    using System.Windows;

    namespace GridPanelTest
    {
        /// <summary>
        /// Interaction logic for Window1.xaml
        /// </summary>
        public partial class Window1 : Window
        {
            public Window1()
            {
                InitializeComponent();
            }

            private void Button_Click(object sender, RoutedEventArgs e)
            {
                firstPanel.Visibility = Visibility.Collapsed;
            }
        }
    }


    William
    • Sugerido como RespostaMoby Disk segunda-feira, 9 de novembro de 2009 17:17
    •  
  • sábado, 7 de novembro de 2009 10:15Rammohan Ammiti Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     


    Hi

    Thanks for your reply.. i have an idea how to collapsed. but i need to remove the first stackpanle space.


    Again Thanks
    Ram
  • sábado, 7 de novembro de 2009 10:34Rammohan Ammiti Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     


    your test application it's working fine.. but same thing i applied in my project it's not working any way thanks i try to fix according your way.. if i have any doubts i will contact to u william


    Again thanks
    Ram
  • sábado, 7 de novembro de 2009 11:15Rammohan Ammiti Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    right now i used the different different stack panels means stakpanel1 and subelements and stackpanle2 with subelements another grid with button but that grid is not in stack panel at that time space is not collapsed ..now pls suggest me.. if i place main grid in stack panle i lost lot of things...

    this way suggest me willam...
  • sábado, 7 de novembro de 2009 18:21William Han - MSFT Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    Hi Rammohan,

    Could you post a simple repro (markup/code) because it helps me to understand the problem better by reading the code and trying it?

    Thanks,
    William
  • segunda-feira, 9 de novembro de 2009 8:09Rammohan Ammiti Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    Hi William,


     Here, i am sending the my test application pls chk it once.



    If i click the first button or secon button of the image.... i need collapsed stack panle and moved to the top .



    Thanks
    Ram
  • terça-feira, 10 de novembro de 2009 5:24William Han - MSFT Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    The repro you shared out is pretty big. There’re many stackpanels, and I don’t know which one you want to collapse.  Is it possible for you to simplify the repro?  And Could you be specific on which stackpanel (like including the panel name) you want it be collapsed?  Thanks.
    William
  • terça-feira, 10 de novembro de 2009 11:04Rammohan Ammiti Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     Respondido

    Hi william,


    I repro my application . i fixed it. throught

     

    public void Refrencestackremove()

    {

    ww.StackPanelTopBodyPanleCaptions.Height = 0;

     

    GridLength gl = new GridLength(0.0);

    ww.TopBodyPanel.RowDefinitions[0].Height = gl;

    }

    #endregion

     



    actually i used the grids under the stack panels that is why i used above function. it's working fine now.


    Thanks
    Ram

    • Marcado como RespostaRammohan Ammiti terça-feira, 10 de novembro de 2009 11:04
    •