Results 1 to 7 of 7

Thread: wpf layout

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2010
    Posts
    18

    wpf layout

    Hi,

    I'm new in WPF and I need to do a Showroom. My question is how can I divide de structure of the form, like <div> in HTML, so that when the contents change only that part is changed and later give some slide effect or whatever...


    Thanks

  2. #2
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: wpf layout

    If you want to have just one part of the window run in its own container then you can use a Frame control.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2010
    Posts
    18

    Re: wpf layout

    ok but the idea is like if you have a car showroom you need to choose de brand of the car, next the model and then the car appears.

    I've already begin the showroom it's not a car showroom but the idea is the same. I did a grid with 3 rows and I'm working in the second row.

    on the load event I've 2 buttons you chose one of them and on the click event of this button I put the visibility of those buttons to hidden to show what I want. what do you think about that? it's bad or I can do this by this way ?

    I'm sorry about my English...

  4. #4
    Lively Member
    Join Date
    Jul 2007
    Posts
    127

    Re: wpf layout

    u can just put a grid or a stackpanel or whatever type of container inside of the outer grid that would fill up your whole window.
    so something similar to this logic here
    Code:
    <Window>
    <Grid Name="OuterGrid">
    <Grid.RowDefinitions>
      <RowDefinition Height="*"></RowDefinition>
      <RowDefinition Height="*"></RowDefinition>
      <RowDefinition Height="*"></RowDefinition>
    </Grid.RowDefinitions>
    <Grid Name="ContentGrid" Grid.Row="1">
    <!--Put all the showroom stuff that you want changed in here-->
    </Grid>
    </Grid>
    </Window>

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Apr 2010
    Posts
    18

    Re: wpf layout

    nice, thanks a lot.

    I've another question.

    in windows1_loaded (etc)...

    I've a button created by code called Botaocat. Now I need to get the click event of this button, how can i do this =

  6. #6
    Lively Member
    Join Date
    Jul 2007
    Posts
    127

    Re: wpf layout

    by get the click event u mean you need to add a click event? add this to window_loaded event then you just need to create the Sub for MyButton_Click

    Code:
    AddHandler MyButton.Click, AddressOf MyButton_Click

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Apr 2010
    Posts
    18

    Re: wpf layout

    yes it's works but now I need to put the botaocat.visibiliti to false...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width