0
Answer

Control.Size returning 'wrong' value

Robin

Robin

16y
2.1k
1
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