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. Getting the size of a control

Getting the size of a control

Scheduled Pinned Locked Moved WPF
question
2 Posts 2 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hello, Whenever I try getting the size of a custom control (inside the code), both ActualWidth/Height and DesiredSize returns either Size(0, 0) or Size(Width, Double.NaN) or Size(Width, Double.PositiveInfinity). Same with Height/Width. Any suggestions? Thanks, Theo

    P 1 Reply Last reply
    0
    • L Lost User

      Hello, Whenever I try getting the size of a custom control (inside the code), both ActualWidth/Height and DesiredSize returns either Size(0, 0) or Size(Width, Double.NaN) or Size(Width, Double.PositiveInfinity). Same with Height/Width. Any suggestions? Thanks, Theo

      P Offline
      P Offline
      PumbaPumba
      wrote on last edited by
      #2

      Hi Theo, Are you trying to get the size of the control from inside the control. I mean inside control's

      ArrangeOverride

      or do you want to get the control's size in application level?

      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