Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make Frame Object Transparent 1

Status
Not open for further replies.

asalve

Programmer
May 19, 2001
4
IN
How do I make a Frame Object transparent so that, the controls on the Frame container are visible but the Frame does not. By setting the "visible" property to 'true' of the Frame, the Frame and the controls on it, both becomes invisible, this is not what I want. I want that only the Frame becomes Transparent, but the controls on it, will still be visible.
 
I think you'll get the effect you desire by setting the borderstyle of the frame to 0 (none).
frame1.borderstyle = 0

Herman :-Q
 
Hi,

The simple version:
Add this to a module in your project:
------------------------------------------------------------
Public Const GWL_EXSTYLE = (-20)
Public Const WS_EX_TRANSPARENT = &H20&
Public Const SWP_FRAMECHANGED = &H20
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Public Const SWP_SHOWME = SWP_FRAMECHANGED Or _
SWP_NOMOVE Or SWP_NOSIZE
Public Const HWND_NOTOPMOST = -2

Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
------------------------------------------------------------

Add this to you form:

------------------------------------------------------------
SetWindowLong Me.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT
SetWindowPos Me.hwnd, HWND_NOTOPMOST, 0&, 0&, 0&, 0&, SWP_SHOWME
------------------------------------------------------------

There several other ways. Goto and search on 'transparent' to get some examples.

Good luck, :) Sunaj
 
I'd have to go with herman on this one...
Set the frames borderstyle to 0 makes it transparent
Dragnut
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top