0

Hi I am trying to render buttons as the item template of a list, to be displayed horizontally. The problem is that they don't 'butt up' to each other. They leave a small gap betwen each one. I have tried allsorts of things to cure it, but have'nt succeeded. Any ideas?

Douglas B. Staple
  • 10,510
  • 8
  • 31
  • 58

3 Answers3

2

Try using the WPF tool Snoop to work out where the margin is coming from, and then fix it.

(Negative margins = code smell, in general, IMO.)

Dan Puzey
  • 33,626
  • 4
  • 73
  • 96
0

Try a negative margin, setting cliptobounds to false, maybe that can help

Machinarius
  • 3,637
  • 3
  • 30
  • 53
0

It's most likely either a Border, Margin, or Padding on your item container (i.e. ListBoxItem if you're using ListBox) which can be corrected with the ItemContainerStyle or your Button's Border is using BorderThickness=1, BorderBrush=Transparent or null.

Use Snoop as Dan suggested to find out.

John Bowen
  • 24,213
  • 4
  • 58
  • 56