Robin

Robin

  • NA
  • 1
  • 0

Control.Size returning 'wrong' value

Jun 20 2008 5:06 PM
Hi all,

I'm trying to line up some dynamically created LinkLabel controls along their bottom edges. What I've done (which seems logical) is to create a variable for the Y value of the line I want them to line up along (called BottomY) and set each control's Y value to BottomY minus the control's size.

This is in code below:

int BottomY = 100;

newLinkLabel->Location = System::Drawing::Point(50, BottomY - newLinkLabel->Height);

However, when I then draw a line at BottomY using Graphics->DrawLine() it turns out that the bottom of the control is not on this line. (I can send a screenshot of this if needed).

This seems rather strange to me - but perhaps I'm missing something. Anybody got any ideas?

I guess this works the same in C# and VB.

Cheers,

Robin