I have 20 usercontrols in the flowlayoutpanel in a windows form.
Each of the user control has a button.
I want to find the position of each button on the flowlayoutpanel. How can I find the X and Y coordinates for the buttons?
I can access the buttons like this:
foreach (Control ctrl in this.pnlContainer.Controls.Find("btnPrint",true))
{
Button c = ctrl as Button;
if (c != null)
{
logger.Info("x: "+c.Location.X + ",y: "+c.Location.Y,c);
}
}
However, the x and y coordinates are always the same.
thanks!