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. WCF and WF
  4. ComboBox Width

ComboBox Width

Scheduled Pinned Locked Moved WCF and WF
question
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.
  • Y Offline
    Y Offline
    yanairon
    wrote on last edited by
    #1

    Hi, Is there any simple way (without code) of setting the ComboBox width to be as it's wider item? Thanks, Yanai

    B 1 Reply Last reply
    0
    • Y yanairon

      Hi, Is there any simple way (without code) of setting the ComboBox width to be as it's wider item? Thanks, Yanai

      B Offline
      B Offline
      BlitzPackage
      wrote on last edited by
      #2

      You can databind it to the width of its widest item using the databinding dialogues in expression blend (assuming that's what you are using). However, it should be able to do that automatically. Make sure that the space you have it in can allow the combobox to be as wide as it should be; then make sure the combobox has its height and width set to auto. Finally, check to see that the widest item can fit in the space alloted to the combobox. Let me know if that helps.

      Y 1 Reply Last reply
      0
      • B BlitzPackage

        You can databind it to the width of its widest item using the databinding dialogues in expression blend (assuming that's what you are using). However, it should be able to do that automatically. Make sure that the space you have it in can allow the combobox to be as wide as it should be; then make sure the combobox has its height and width set to auto. Finally, check to see that the widest item can fit in the space alloted to the combobox. Let me know if that helps.

        Y Offline
        Y Offline
        yanairon
        wrote on last edited by
        #3

        Thanks for the help. unfortunatley i think it won't work for me. The data binding thing i can do only if i know in advanced which items will be in the combo box. what if i bind it to a list of strings? about the automatic thing. it didn't work. i have enough room in a grid's auto size column. the combo box just change it's width every time i choose something from the list to fit the minimum width required (by controls on the same column) any solution for that? Thanks, Yanai

        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