Unwanted trailing whitespace in controls

  • Thread starter Thread starter Michael Winter
  • Start date Start date
M

Michael Winter

In VB .NET 2002, I've discovered a rather bizarre phenomenon where a block
of whitespace trails after text in certain controls. If the control isn't
wide enough, the text is truncated *and* justified. For example, a group
box would appear as

+-- Some text here ----+ rather than +-- Some text here -------+
| | | |

Labels, checkboxes and radio buttons behave similarly. I never had this
problem with VB6.

Whilst this isn't a major concern, it can affect subtler aspects of form
layout, as well as looking visually inconsistent.

Any suggestions? Preferably ones other than, "live with it." :)

Mike
 
* "Michael Winter said:
In VB .NET 2002, I've discovered a rather bizarre phenomenon where a
block of whitespace trails after text in certain controls. If the
control isn't wide enough, the text is truncated *and* justified. For
example, a group box would appear as


+-- Some text here ----+ rather than +-- Some text here -------+
| | | |

Labels, checkboxes and radio buttons behave similarly. I never had
this problem with VB6.


Whilst this isn't a major concern, it can affect subtler aspects of
form layout, as well as looking visually inconsistent.

I assume that setting the controls' 'FlatStyle' property to 'System'
will fix the problem. Maybe it's caused because GDI+ is used for
drawing the controls.
 
* "Michael Winter said:
In VB .NET 2002, I've discovered a rather bizarre phenomenon where a
block of whitespace trails after text in certain controls.
[snip]

I assume that setting the controls' 'FlatStyle' property to 'System'
will fix the problem. [...]

Indeed it does. Thank you very much for your help.

Mike
 
Back
Top