Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Transparent Form
Message
 
To
10/05/2007 15:11:42
Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01224014
Message ID:
01224349
Views:
34
I'm doing something like a Windows Vista Gadget on an XP desktop



>Hugo's code is very cool indeed, however, I find it difficult to use a form that is 100% transparent. IMO, if the transparent area could somehow blur or become less obvious, it would be a better user experience (I finally got to use that buzz term).
>
>I'm really curious, how are you using this effect?
>
>Mike
>
>>That did it. Perfect.
>>
>>Thanks!
>>
>>
>>>Kevin,
>>>
>>>IIRC, the transparency effect works for one color, so what you should do is set the background property of your form to some unique, not used in other control color, thus making only the form transparent
>>>
>>>[Update]
>>>
>>>Here is the effect, what happens to you, I believe, is the same as if you change the backcolor of the form to white, so in the example I choosed a close to white color for the form, but not quite
>>>
>>>
>>>PUBLIC oform1
>>>
>>>oform1=NEWOBJECT("form1")
>>>oform1.Show
>>>RETURN
>>>
>>>
>>>	**************************************************
>>>*-- Form:         form1 (x:\foxv\hugo\prog\transparent.scx)
>>>*-- ParentClass:  form
>>>*-- BaseClass:    form
>>>*-- Time Stamp:   05/10/07 09:09:08 AM
>>>*
>>>DEFINE CLASS form1 AS form
>>>
>>>
>>>	ShowWindow = 2
>>>	DoCreate = .T.
>>>	Caption = "Form1"
>>>	BackColor = RGB(254,254,254)	&& changing to 255,255,255 will make the edit and text boxes transparents too
>>>	Name = "Form1"
>>>
>>>
>>>	ADD OBJECT command1 AS commandbutton WITH ;
>>>		Top = 218, ;
>>>		Left = 286, ;
>>>		Height = 27, ;
>>>		Width = 84, ;
>>>		Caption = "Exit", ;
>>>		Name = "Command1"
>>>
>>>
>>>	ADD OBJECT text1 AS textbox WITH ;
>>>		Height = 23, ;
>>>		Left = 17, ;
>>>		Top = 14, ;
>>>		Width = 126, ;
>>>		Name = "Text1"
>>>
>>>
>>>	ADD OBJECT edit1 AS editbox WITH ;
>>>		Height = 53, ;
>>>		Left = 17, ;
>>>		Top = 41, ;
>>>		Width = 124, ;
>>>		Name = "Edit1"
>>>
>>>
>>>	PROCEDURE Init
>>>		#DEFINE LWA_COLORKEY	1
>>>		#DEFINE LWA_ALPHA		2
>>>		#DEFINE GWL_EXSTYLE		-20
>>>		#DEFINE WS_EX_LAYERED	0x00080000
>>>
>>>		DECLARE INTEGER SetLayeredWindowAttributes IN win32api;
>>>		      INTEGER HWND, INTEGER crKey, INTEGER bAlpha, INTEGER dwFlags
>>>		DECLARE INTEGER SetWindowLong IN user32.DLL ;
>>>		   INTEGER hWnd, INTEGER nIndex, INTEGER dwNewLong
>>>		DECLARE INTEGER GetWindowLong IN user32.DLL ;
>>>		   INTEGER hWnd, INTEGER nIndex
>>>
>>>		local lnFlags
>>>
>>>		lnFlags	= BITOR(GetWindowLong(thisform.HWnd, GWL_EXSTYLE), WS_EX_LAYERED)
>>>		SetWindowLong(thisform.HWnd, GWL_EXSTYLE, lnFlags)
>>>		SetLayeredWindowAttributes(thisform.HWnd,thisform.backCOlor, 0, LWA_COLORKEY)
>>>	ENDPROC
>>>
>>>
>>>	PROCEDURE command1.Click
>>>		thisform.Release()
>>>	ENDPROC
>>>
>>>
>>>ENDDEFINE
>>>*
>>>*-- EndDefine: form1
>>>**************************************************
>>>
>>>
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Reply
Map
View

Click here to load this message in the networking platform