В нашем настольном приложении C# WPF мы используем system.windows.controls.combobox в нашем коде xaml. Мы используем один и тот же код MVVM для некоторых из этих окон уже несколько лет, и, похоже, после того, как мы перенесли наши проекты на .Net 8 из .Net Framework 4.8, у нас возникли некоторые проблемы с шириной ComboBox. В частности, это произойдет, если у нас есть HorizontalAlignment="Left"
Например, наш код будет следующим:
Код: Выделить всё

Without changing any code, the combo box now displays as with .Net 8:

The dropdown arrow now overlaps with the text. Once I remove the HorizontalAlignment="Left" it seems to have the correct width but obviously not lined up as preferred:

This seems to be a bug with Microsoft.WindowsDesktop.App.Ref\8.0.2\ref\net8.0\PresentationFramework.dll ??
I have .Net 8.0.3 installed.
Is this a known bug or are there some code changes I should now implement?
Thanks for all and any input!
I tried using DevExpress' dxe: ComboBoxEdit and their control works here, but we would like to be consistent across our application and not have to change all of our controls from Microsoft to third-party library controls.
When we updated to .Net 8, we expected to have our normal Microsoft Windows ComboBoxes working appropriately with the correct width.
We used our application and noticed several of our combo boxes in our WPF c# application were way too narrow which would not let the user see the data in the combo boxes with the overlapping dropdown arrow.
Источник: https://stackoverflow.com/questions/781 ... obox-width
Мобильная версия