question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to align content of ComboBox by center?

See original GitHub issue

Unlike different controls ComboBox doesn’t have HorizontalContentAlignment property.

Is there is any replacement for this? If not can it be added then?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
maxkatz6commented, Jul 2, 2020

@FoggyFinder it seems like a problem with properties overriding - https://github.com/AvaloniaUI/Avalonia/issues/2098 HorizontalAlignment is defined in the template, so it can’t be overridden with style.

I will implement ComboBox.HorizontalContentAlignment to avoid that problem.

For now you can only replace whole ComboBox template with alignment-center.

1reaction
maxkatz6commented, Jul 1, 2020

@FoggyFinder You can set it with style

<Style Selector="ComboBox /template/ ContentControl">
   <Setter Property="HorizontalContentAlignment" Value="Right" />
</Style>
Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Align Text in Combobox
Text align center (text area and the dropdown). For the text area, find the Edit control and set the ES_CENTER style for the...
Read more >
ComboBox.TextAlign property (Access)
The TextAlign property specifies the text alignment in new controls. Read/write Byte. Syntax. expression.TextAlign. expression A variable that ...
Read more >
Combo box text center alignment
Hello Everyone, I have small question regarding the combo box!! I have a created a combo box which has list of items (dropdown)....
Read more >
How to specify text alignment in WinForms ComboBoxAdv?
In ComboBoxAdv, you can specify the text alignment by using its TextAlign property. The following code example illustrates the same. C#. this.comboBoxAdv1.
Read more >
How to make text center align for non-editable ComboBox
In this article we will see how we can center align the text of combo box and combo box should remain non-editable. By...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found