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