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. Make textbox fill up and resizie

Make textbox fill up and resizie

Scheduled Pinned Locked Moved WPF
csharpcsswpf
3 Posts 3 Posters 2 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.
  • A Offline
    A Offline
    Acuena
    wrote on last edited by
    #1

    Hi! Sorry for weird subject but was a bit unsure on what to call it. Anyway, I have a WPF-form where I have some items below a textbox. I want the textbox to fill up the grid above the bottom controls but leave space for them.

    Richard DeemingR L 2 Replies Last reply
    0
    • A Acuena

      Hi! Sorry for weird subject but was a bit unsure on what to call it. Anyway, I have a WPF-form where I have some items below a textbox. I want the textbox to fill up the grid above the bottom controls but leave space for them.

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      Sounds like you want a DockPanel instead of a Grid. DockPanel Class (System.Windows.Controls) | Microsoft Docs[^] How to: Choose Between StackPanel and DockPanel - WPF .NET Framework | Microsoft Docs[^]


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      1 Reply Last reply
      0
      • A Acuena

        Hi! Sorry for weird subject but was a bit unsure on what to call it. Anyway, I have a WPF-form where I have some items below a textbox. I want the textbox to fill up the grid above the bottom controls but leave space for them.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        When you put Grids in a StackPanel, the Grids "lose" their "star" (*) qualities since StackPanel do not fill available space. You should put your Grids in a parent Grid instead of a StackPanel (if you want to make the most of "stretching"). I typically start everything with "*" or Auto; only afterwards do I (rarely) touch up with explicit widths or heights.

        It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food

        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