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

Win 7 Transparency in Top Level Form

Status
Not open for further replies.

petersen909

Programmer
Aug 7, 2015
8
US
I have been relying on this forum since I started learning VFP and can't even begin to thank all of you for the solutions I have found over the years. I have found my first issue that hasn't been discussed here previously, or so I think, I ran a pretty extensive search before posting.

I have normally created projects that use the default VFP Screen with my own menus, etc. I am trying out my first project that _screen is set to off and is contained within a top-level form. When I run the Main Form in WindowState = 0 the Title Bar is transparent in Windows 7, and when I maximize the form it stays transparent. If I change WindowState = 2 and recompile and run the Title Bar is the opaque blue standard VFP form style. The usual resources have not helped.

Matt
 
Hello Matt,

Glad to hear the forum has been useful to you.

You don't actually say what your problem is. Are you saying that you want the title bar not to be transparent? If so, the first thing I would try is [tt]_screen.Themes = .F.[/tt] at the top of your main program. Give that a try, and if it doesn't solve the problem, report back.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I want the Form's title bar to be transparent, which works when I have WindowState = 0. As soon as I change the WindowState property to 2 the transparency fails and goes back to the opaque blue style. Themes are set to .T. and toggling DeskTop T/F did nothing.
 
You set _screen invisible, so did you set your own form as top level form? Only those would have the transparent title bar.

I just tried my faq184-6512 andthe exe built with it has a transparent titlebar, also maximised.
But I see what you see, if I set WindowType=2 at design time the titlebar gets blue.

What works is, doing this in Activate:

Code:
If NOT This.lActivated
   This.lActivated = .T.
   This.WindowState = 2
Endif

You add a lActivated property as .F. and this will be checked and set .T., so this code just runs once at first activation of the form. It's not working to set WindowState=2 in Load or Init. That is too early, as is at designtime.

Bye, Olaf.
 
That worked Olaf, Thank you. Thank you to Mike as well, have used both of your contributions to this site over the years.
 
You're welcome, Petersen.

It's good to see some of the silent participants, too. I can only encourage anyone coming here, even just to contribute ideas or show what helped.

Bye, Olaf.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top