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

How to use Windows 10 style of title bar in VFP 7? 2

Status
Not open for further replies.

gryff15

Programmer
Sep 21, 2016
47
PH
Untitled_jwuddb.png


I noticed that VFP forms use a 3D design like in Windows 7. I cannot find in the properties where I can change it to fit the Windows 10 flat design.

- webrider -
 
There is I think it's a bit off, but as all sources are there you could adjust it as you like.
I just smell a bit of problems when the form title bar is replaced with a container. Even though the form size is auto-adjusted, I think you can get problems with anchoring and resizing, even though the project description shows some properties to choose behaviors.

And I think this project also implies there is no simple fix with _screen.themes or Sys(2700).

Without using this, the simplest almost-solution is to set Form.Desktop=.T. for all forms. Then you get a flat titlebar, but the forms can be moved outside of _screen or another main top-level form. And in resizable borderstyle 3 the Aero styling still draws a shadow of the Window.

Maybe you could live with that already. I think the Paint event could be where to try other things, ie repressing VFPs Paint behavior and using Windows API there. But I haven't tried that.

Chriss
 
Sorry, I overlooked you search for VFP7. I had the impression VFP9 was the only version implementing Aero fully correct, I relate VFP7 to XP. Then you don't have _screen.themes and sys(2700) at hand at all. It's also likely the ThemedTitleBar won't work in VFP7, rest assured upgrading to VFP9 also isn't resolving that problem, but will be a basis to make more use of projects of VFPX.

Chriss
 
Hi webrider,

the easiest way to do this, is using a manifest file

download here: Link

1) if Your application ist named xyz.exe just rename name.exe.manifest to xyz.exe.manifest

2) now copy xyz.exe.manifest into the same folder of Your xyz.exe

this is tested and working for VFP6 !!!

Regards, Stefan

 
Hi StefanFoerner,

I doesn't work. I was referring to the form itself, not the exe as a whole. My exe has a lot of forms in it and when I toggle the TitleBar and ControlBox, it doesn't have the same style as the exe itself and other windows programs. It looks like it's from Windows 7 style.

Untitled_lk06rj.png


Hi Chris Miller,

Indeed. The ThemedTitleBar does not seem to work on VFP 7. :(

- webrider -
 
Hi webrider,

that is strange :-(

here is a screen shot of my VFP6 application:

ProgressTaskbar_drixqa.jpg


my exe ist named: wein.exe
my manifest file ist named: wein.exe.manifest (do not edit the content of the manifest file !!!)
the exe and the manifest file are located in the same directory

nothing done else !!!

all forms contained in my wein.exe have automatically windows style - in this example windows 10 style

- maybe this is a bug of VFP7 ???

Note:

- controls of comctl32.ocx, comct232.ocx, comct332.ocx, comdlg32.ocx, richtx32.ocx, etc. have windows style
- controls of mscomctl.ocx, mscomct2.ocx does NOT have windows style !!!

Regards, Stefan
 
Hi Stefan,

Here is another sample. The main exe is Win10 style but the form inside it is not.

Untitled_bg4xzr.png


- webrider -
 
Hi webrider,

i have set the following properties:

main form:

- Desktop = .T. ; <== try this first !!!
- ShowWindow = 2 ; As Top-Level Form
- WindowType = 0 ; Modeless

all other sub forms:

- Desktop = .T. ; <== try this first !!!
- ShowWindow = 1 ; In Top-Level-Form
- WindowType = 0 ; Modeless

try these settings

==> I guess it is the property Desktop, You must set it to .T. !!!

if I set Desktop = .F., I have the same behavour as You: window frame is Old Windows Style !

Regards, Stefan
 
As I said:

myself said:
the simplest almost-solution is to set Form.Desktop=.T. for all forms

So together with a manifest this becomes a better solution already. The question is, whether you'd not want forms to be movable anywhere on the desktop. The only argument against it would be if each form has an entry in the taskbar and clutters it, but that's not happening.

Chriss
 
Hi Chriss,

You are right:

- only forms with ShowWindow = 2 (As Top-Level Form) appear in the taskbar (and in the task manager)

- forms with Desktop = .T. don't appear in the taskbar (and in the task manager)

Regards, Stefan
 
Another piece of the puzzle. Windows advanced systm settings has an option to turn window shadows off:


On the other side, this also makes it a win10 feature users might control themselves. Overall you can let Windows try to balance visual effects with system performance and graphics capabilities.
Well, that's off topic anyway, your question only related to the titlebar look.

On the topic, setting a forms ColorSource to 5 gives an even more flat look. In screen (or in top-level) forms will now look blank, without even a gray line separating their title bar from the canvas.
I tried it to see whether that makes VFP windows get dark when you pick the dark mode of Windows themes/styles, but that still doesn't get through.

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top