Tuesday 15 March 2011

WPF ComboBox DropDown Placement -


I have a content control that is on the right side of a button, partitions and a combo box from left to the combo box dropdown. I want to line up with the left side of the control as opposed to the left side of the boxbox. Documents can not be found on relative placements, etc. Has anyone dealt with this? TIA

I did something before - I ended up with the combo box, taking part of the popup Control to control it and use it. Something like this ...

  class MyComboBox: combo box {public override zero OnApplyTemplate () {base.OnApplyTemplate (); Var popup = (popup) template.findname ("PART_Popup", this); Popup.placement = PlacementMode Custom; Popup.CustomPopupPlacementCallback = placePopup; } Private custom popup place [] place popup (size popup size, size target size, point offset) {var placements = new [] {new custom poppling ()}; Placements [0] Points = // status drop down here! Return placement; }}  

No comments:

Post a Comment