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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form with a Drop shadow?

Status
Not open for further replies.

jcairo

Technical User
Jul 23, 2007
10
PT
Can anybody give me any tips on how to give a form a drop shadow? Like on the dropdown portion of a combo box.
I use vfp9 and xp.

From the internet I thought this might work in the form init, but it doesn't seem to...
Code:
#DEFINE GCL_STYLE	00000803 
#DEFINE CS_DROPSHADOW	0x00020000

DECLARE INTEGER SetClassLong IN win32api;
      INTEGER HWND, INTEGER nIndex, LONG dwNewLong

SetClassLong(Thisform.HWnd,GCL_STYLE,CS_DROPSHADOW)

Thanks in advance.
 
Possibly you could use the SetLayeredWindowAttributes() function for this.

The following article might help. It doesn't directly address your problem, but it might prove a good starting point:


Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Thanks very much for your suggestion.

I already use the SetLayeredWindowAttributes() function to make some little green areas tansparent, so the form has rounded corners.

I have since discovered that if I change the line in the previous code to
#DEFINE GCL_STYLE -26 it works. All forms created after running that code have a rectangular drop shadow, but that looks a bit strange with a form that has rounded corners.

What would be great would be to run SetLayeredWind...once to make my green areas transparent and then again to make some other colour semi transparent. But AFAIK it doesn't work that way.
 
JCairo,

In my experiments in this area, I found that I could make the form semi-transparent if it was a top-level form. It didn't work with a normal form.

It might be worth trying it with a top-level form to see if that gives you the ability to hide the unwanted corners.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top