IT/C#

[C#] UI Control 둥근 테두리 만들기

Ella.J 2018. 11. 14. 18:25
728x90
반응형





1
2
3
4
5
6
7
8
[DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")]
private static extern IntPtr CreateRoundRectRgn(int nLeftRect,
int nTopRect, int nRightRect, int nBottomRect, int nWidthEllipse, int nHeightEllipse);
 
private void Form1_Load(object sender, EventArgs e) {
    pnlComponent.Region = Region.FromHrgn(CreateRoundRectRgn(00, pnlComponent.Width, pnlComponent.Height, 1515));
    lblCAM.Region = Region.FromHrgn(CreateRoundRectRgn(00, lblCAM.Width, lblCAM.Height, 1515));
    lblPOWER.Region = Region.FromHrgn(CreateRoundRectRgn(00, lblPOWER.Width, lblPOWER.Height, 1515)); 
}
cs


728x90
반응형