Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Is there similar properity like Anchor Properity in WPF?

Is there similar properity like Anchor Properity in WPF?

Scheduled Pinned Locked Moved WPF
csharpwpfquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bkbharani
    wrote on last edited by
    #1

    Like in .NET FW 2.0, there is Anchor property to set the controls Auto arrange. It will be much helpful if anyone could share info about similar property in WPF

    M J 2 Replies Last reply
    0
    • B bkbharani

      Like in .NET FW 2.0, there is Anchor property to set the controls Auto arrange. It will be much helpful if anyone could share info about similar property in WPF

      M Offline
      M Offline
      MIHAI_MTZ
      wrote on last edited by
      #2

      For objects that are placed inside a grid a combination of HorizontalAlignment, VerticalAlignment and Margin can be used to control the position in a similar way to "Anhor". Anchor right & bottom <=> HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin=",,," Anchor left & right <=> HorizontalAlignment="Stretch". As I said the controls must be placed inside a grid; Mihai,

      B 1 Reply Last reply
      0
      • M MIHAI_MTZ

        For objects that are placed inside a grid a combination of HorizontalAlignment, VerticalAlignment and Margin can be used to control the position in a similar way to "Anhor". Anchor right & bottom <=> HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin=",,," Anchor left & right <=> HorizontalAlignment="Stretch". As I said the controls must be placed inside a grid; Mihai,

        B Offline
        B Offline
        bkbharani
        wrote on last edited by
        #3

        Thank You

        1 Reply Last reply
        0
        • B bkbharani

          Like in .NET FW 2.0, there is Anchor property to set the controls Auto arrange. It will be much helpful if anyone could share info about similar property in WPF

          J Offline
          J Offline
          Jammer 0
          wrote on last edited by
          #4

          Don't think in terms of anchors ... WPF is a different beast. As well as using Layout Grids you need to think about putting stack panels and so forth inside grids in order to get the layout of things working properly. Simply using grids and then margins and so on will yield a UI that doesn't always scale well. Grids are good for deviding up UI but not the best way to actually position things ...

          Jammer Going where everyone here has gone before! :) My Blog | Article(s)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups