回复 10楼 linkhai
看了一下,有个问题:当Shape的Curvature值大点时窗体的4个角明显。变了一下不用GDI,改用几个相关的 WinAPI。
示例
程序代码:
of = CREATEOBJECT("Form1") of.show READ EVENTS DEFINE CLASS Form1 as Form Desktop = .T. ShowWindow = 2 WindowType = 1 AutoCenter = .T. BorderStyle = 1 TitleBar = 0 BorderStyle = 0 ADD OBJECT Shape1 as Shape WITH top=0,left=0,Width=this.Width,Height=this.Height,Curvature=50,BackColor=RGB(250,240,240) ADD OBJECT Command1 as CommandButton WITH Top=50,Left=100,Height=25,Caption="Color" ADD OBJECT Command2 as CommandButton WITH Top=100,Left=100,Height=25,Caption="Exit" PROCEDURE UnLoad CLEAR EVENTS ENDPROC PROCEDURE Load DECLARE LONG SetWindowLong IN user32 LONG, LONG, LONG DECLARE LONG GetWindowLong IN user32 LONG, LONG SetWindowLong(this.hWnd, -20, BITOR(GetWindowLong(this.hWnd, -20), 0x80000)) ENDPROC PROCEDURE Activate IF EMPTY(this.Tag) this.Tag = "1" DECLARE LONG SetLayeredWindowAttributes IN User32 LONG, LONG, LONG, LONG SetLayeredWindowAttributes(this.HWnd, this.BackColor, 0, 1) ENDIF ENDPROC PROCEDURE Command1.Click thisform.Shape1.BorderColor = GETCOLOR(thisform.Shape1.BorderColor) ENDPROC PROCEDURE Command2.Click thisform.Release ENDPROC ENDDEFINE
[ 本帖最后由 吹水佬 于 2015-10-7 16:48 编辑 ]