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. A Combobox size within menu [modified]

A Combobox size within menu [modified]

Scheduled Pinned Locked Moved WPF
wpfcsharphelpquestion
3 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.
  • S Offline
    S Offline
    Saksida Bojan
    wrote on last edited by
    #1

    Hello. After a long time i again pick WPF. Since this is nearly a hobby, i didn't learn much or forgot about it.

    I tried that. I Wanted ComboBox to use a size to take all spaced that shows menu. But in my case. It is a little to big. I do not wan't to explictly define the width of ComboBox. Can someone help me? Thank you in advance. Edit: I used SizeChanged on a menu and used the folowing.

    comboBoxProcessList.Width = (Double)((Menu)sender).ActualWidth - 15;

    I do not like the current solution. It would be best if it was possible to do in xaml or if i could get the size of a ContentPresenter of the parrent element. In my case it is Menu

    modified on Saturday, August 27, 2011 3:04 PM

    A 1 Reply Last reply
    0
    • S Saksida Bojan

      Hello. After a long time i again pick WPF. Since this is nearly a hobby, i didn't learn much or forgot about it.

      I tried that. I Wanted ComboBox to use a size to take all spaced that shows menu. But in my case. It is a little to big. I do not wan't to explictly define the width of ComboBox. Can someone help me? Thank you in advance. Edit: I used SizeChanged on a menu and used the folowing.

      comboBoxProcessList.Width = (Double)((Menu)sender).ActualWidth - 15;

      I do not like the current solution. It would be best if it was possible to do in xaml or if i could get the size of a ContentPresenter of the parrent element. In my case it is Menu

      modified on Saturday, August 27, 2011 3:04 PM

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      Try using a margin or padding with the Combobox code above.

      Too much of heaven can bring you underground Heaven can always turn around Too much of heaven, our life is all hell bound Heaven, the kill that makes no sound

      S 1 Reply Last reply
      0
      • A Abhinav S

        Try using a margin or padding with the Combobox code above.

        Too much of heaven can bring you underground Heaven can always turn around Too much of heaven, our life is all hell bound Heaven, the kill that makes no sound

        S Offline
        S Offline
        Saksida Bojan
        wrote on last edited by
        #3

        I did try Padding and Margin and it didn't work. I know the auto size is based on a child. But in my case i want it to be based on a parrent.

        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