不规则窗体小技巧

1.移动没有标题栏的窗体

 

在任何控件的OnMouseDown事件中加入以下代码:

 

 

[delphi] view plain copy
 
  1. if (Button = mbLeft) then  
  2. begin  
  3.   ReleaseCapture;  
  4.   Self.Perform(WM_SYSCOMMAND, $F012, 0);  
  5. end;  
 

 

 

2.创建圆角矩形窗体

 

 

[delphi] view plain copy
 
  1. procedure TForm1.FormCreate(Sender: TObject);  
  2. var  
  3.   RgnHandle: THandle;  
  4. begin  
  5.   RgnHandle:= CreateRoundRectRgn(0, 0, Width, Height, 9, 9);  
  6.   SetWindowRgn(Handle, RgnHandle, True);  
  7. end;  

 

 
 http://blog.csdn.net/dropme/article/details/4504518

 

posted @ 2016-03-14 23:00  findumars  Views(238)  Comments(0Edit  收藏  举报