Click here to Skip to main content
15,920,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hey guys
i got a little problem
i got a first panel on a form which is called panel1
it is anchor to left,right,top,bottom
and it's size is 881, 593 and it's location is 0, 102

i add another panel on panel1 which is now called panel2
i set it size to 250,250 and i would like that panel2 to be fitted in the middle of panel1
Posted
Comments
Richard C Bishop 29-Nov-12 11:26am    
That is not a question. Please use the "Improve Question" function to elaborate, provide code, and ask an actual question.

1 solution

So: set the Top and Left to:
Left = (WidthOuterPanel - WidthInnerPanel) / 2
Top  = (HeightOuterPanel - HeightInnerPanel) / 2
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900