开发者

Why does this ComboBox render differently on other PCs?

I'm troubleshooting an issue with the positioning of the PART_Popup section of a ComboBox in a WPF application. It aligns differently depending on what system you run it on. I don't have enough PCs available to determine the pattern behind it.

edit

Sorry for the poor images. I've requested some larger ones.

You can think of the surface area of the Window like this (in pseudo):

<Grid>
  <Column>
    <StackPanel>
        <Button>Create Story</Button>
        <Button>Continue Story</Button>
        <Button>Close Story</Button>
    </StackPanel>
  </Column>
  <Column>
    <Border>
      <Grid>
        <Row>
          <Column><TextBlock>Story Name</TextBlock></Column>
          <Column><ComboBox ItemsSource="..." /></Column>
        </Row>
        <Row>
          <Column />
          <Column><Button /></Column>
        </Row>
      </Grid>
    </Border>
  </Column>
</Grid>

PC 1

Why does this ComboBox render differently on other PCs?

PC 2

Why does this ComboBox render differently on other PCs?

On one PC, PART_Popup aligns to the left edge of the Control. On another PC, it aligns to the right side. The exe is identical.

The ComboBox uses [this style][3] as a {DynamicResource}. The ToggleButton and ComboBoxItem have [these styles][4].

edit

Responses:

  • Both screen shots were captured on LtR computers.
  • In the original diagrams, there were no carriage returns; we commented that there were multiple ComboBoxItems present. Sorry for the inconsistent photos.
  • For the sake of clarity, a single ComboBoxItem is present in both photos. Despite this, the behaviour is identical with > 1 ComboBoxItem.
  • I've been advised that, should ComboBoxItem.Content become t开发者_如何学运维oo long (much longer than illustrated here), PART_Popup will begin resizing to the right once all available Window space is consumed to the left. This occurs only on on PC #2.


I see 2 completely different pics.

One has a story button, the other doesnt. One has a singlew-line textbox, the other a multi-line. And then there's the thing that your screenshots are too dark...

Or to put it in other words, you've really tried your best to make it very unclear for other people.


Is the testing system running with a right-to-left layout, due to Windows language settings or some such?


One string looks like it has carriage returns the other doesn't. The extremely long description + all the gook after it is one word as far as the system is concerned. Throw some returns in there and see if it changes. You probably have some container dynamically sizing, one huge word will make things stretch out.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜