delphi 컨트롤 필렛

638 단어 Delphi
procedure TForm1.RoundControl(Control: TWinControl; arc1, arc2 :Integer);

var

  R: TRect;

  Rgn: HRGN;

begin

  with Control do

  begin

    R := Control.ClientRect;

    Rgn := CreateRoundRectRgn(R.Left, R.Top, R.Right, R.Bottom, arc1, arc2);

    //Perform(EM_GETRECT, 0, LParam(@R));

    InflateRect(R, -5, -5);       //  R 5

    Perform(EM_SETRECTNP, 0, LParam(@R));  //    EM_SETRECT,          

    SetWindowRgn(Control.Handle, Rgn, True);

    Invalidate;

    {-------------

    Perform(EM_SETRECT, 0, LParam(@R));

    ----------------------}

  end;

  //     name                 

end;


좋은 웹페이지 즐겨찾기