Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Glen Villar
  Where is Glen Villar?
 Cabanatuan
 Philippines
 Glen Villar
 To: Anil Sharma
  Where is Anil Sharma?
 ludhiana
 India
 Anil Sharma
 Tags
Subject: RE: Change the color of the title bars
Thread ID: 198186 Message ID: 198544 # Views: 31 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Win32API programming
Date: Monday, October 13, 2008 10:21:55 AM         
   


> Here is link to change the color of form's title bar. But the problem is with this api is its changing all windows's titile bar. Can anybody improve it so it will effect only vfp.! :)
>
> http://www.tek-tips.com/faqs.cfm?fid=6071
>
> Anil
> My Blog


"There are usually many ways to skin a Fox ..."

-Malcolm Greene



Here's another idea from this site below:

http://www.foxdevsd.org/ftp/Newsletters/Newsletter_2001_12.txt

I wrote this code based on that idea, have fun!

Local oForm

oForm = Createobject("TestForm")
oForm.Show(1)
Return

Define Class TestForm As Form
	Height = 200
	Width = 250
	TitleBar = 0
	BorderStyle = 1
	AutoCenter = .T.

	Add Object Container1 As ConTitle

	Procedure Init
		This.Container1.AddObject('Cont1','ConMax')
		This.Container1.Cont1.Left = This.Width - This.Container1.Cont1.Width
	Endproc

	Procedure Container1.DblClick
		This.Parent.WindowState = Iif(This.Parent.WindowState = 0,2,0)
		Thisform.Container1.Cont1.Left = Thisform.Width - Thisform.Container1.Cont1.Width
	Endproc
Enddefine

Define Class ConTitle As Container
	Width = Sysmetric(1)
	SpecialEffect = 0
	BorderWidth = 0
	Height = 20
	BackColor = Rgb(245,105,205)

	Add Object LblTitle As Label With ;
		Caption = ' Double Click Me', ;
		BackStyle = 0, ForeColor = Rgb(255,255,255), FontBold = .T.

	Procedure LblTitle.DblClick
		This.Parent.Parent.Container1.DblClick
	Endproc

Enddefine

Define Class ConMax As Container
	Width = 15
	Height = 20
	SpecialEffect = 0
	BackColor = Rgb(145,045,205)
	Left = 30
	Visible = .T.

	Add Object LblClose As Label With ;
		Caption = ' X', BackStyle = 0, ForeColor = Rgb(255,255,255), FontBold = .T.

	Procedure LblClose.Click
		This.Parent.Parent.Parent.Release
	Endproc
Enddefine





(coffee)
DeepLogic Computers & Software / Acer Lending Investor



COMPLETE THREAD
Change the color of the title bars Posted by Anil Sharma @ 10/9/2008 3:12:02 PM
RE: Change the color of the title bars Posted by tushar @ 10/9/2008 3:30:18 PM
RE: Change the color of the title bars Posted by Koen Piller @ 10/9/2008 7:42:56 PM
RE: Change the color of the title bars Posted by Anil Sharma @ 10/10/2008 6:17:40 AM
RE: Change the color of the title bars Posted by Bernard Bout @ 10/13/2008 8:14:18 AM
RE: Change the color of the title bars Posted by Anil Sharma @ 10/13/2008 8:40:06 AM
RE: Change the color of the title bars Posted by Anup Singh @ 10/13/2008 9:12:22 AM
RE: Change the color of the title bars Posted by Glenn Villar @ 10/13/2008 10:21:55 AM
RE: Change the color of the title bars Posted by Anil Sharma @ 10/13/2008 10:37:13 AM
RE: Change the color of the title bars Posted by Glenn Villar @ 10/13/2008 10:50:28 AM
RE: Change the color of the title bars Posted by Anil Sharma @ 10/13/2008 10:54:29 AM