views:

36

answers:

1

I want to make a table header:

The steps I have taken

  • Made a user control
  • Placed a TableLayoutPanel on it(this is basically a grid layout?)
  • Added and removed the number of columns/rows I wanted
  • Placed a label in each cell
  • For each label set its dock to fill and borderstyle to fixedsingle

However the borders are not lined up against each other but instead there is a gab, that makes the whole thing look very ugly.

The border size is also very small, how can I make it bigger?

+1  A: 

You can remove the gaps by changing the lable margin property to 0,0,0,0 but the borders will double up in thickness where they meet (Leaving the outer border thinner)

You can disable the borders on the individual labels and use the TableLayoutPanel CellBorderStyle property to get a consistent look with several options for line styles but this will affect all cells, not just the header.

If the TabelLayoutPanel is a fixed size perhaps a background image?

I have no idea how to make the borders thicker in winforms, This is where WPF rules but beats you over the head for using it.

Mike

Mike B