Image Doesn't Align Properly

T

TC

I'm trying to create a Label control with an image flush against the
left edge. For some reason, however, VB always puts 2 white pixels
between the left edge and the start of the image. As far as I can
figure, the problem seems to be with using MiddleLeft for the
ImageAlign property.

Can anyone offer advice on how to fix or workaround this problem?

Here is a snip of the relevant code:

.Image = New Drawing.Bitmap("TitleImage.bmp")
.ImageAlign = Drawing.ContentAlignment.MiddleLeft
.BorderStyle = BorderStyle.FixedSingle


-TC
 
A

Armin Zingler

TC said:
I'm trying to create a Label control with an image flush against the
left edge. For some reason, however, VB always puts 2 white pixels
between the left edge and the start of the image. As far as I can
figure, the problem seems to be with using MiddleLeft for the
ImageAlign property.

Can anyone offer advice on how to fix or workaround this problem?

Here is a snip of the relevant code:

.Image = New Drawing.Bitmap("TitleImage.bmp")
.ImageAlign = Drawing.ContentAlignment.MiddleLeft
.BorderStyle = BorderStyle.FixedSingle


The space between is "by design". To get it differnt, you can paint the
image on your own in the Paint event.


Armin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top