GdiplusX Glowing buttons revisited

Published on by Yousfi Benameur

 
 this is a demo for a glowingButton class ,from the original author Bernard Bout Brisbane ,Australia www.foxite.com (thanks).
it was presented with another method as a single prg.I published it in foxite a while ago.
The code asks simply to point to the gdiplusX class to make the code working( mandatory).
its draws a large  variety of glowing buttons with some events....(see the photo below)
buttons have same backcolors derived from black (see beforeDraw method).The captions are drawn with halos.
the form is movable by mousedown event.
Can arrange them otherwise as shown on the form (horizontally,vertically or even in a container) to simulate a real clicked  menu.
In the method "my" used by bindevent you can put any custom code for any button and to fire any action.
this code can substitute the CSS web menu as well presented in my previous post :
http://yousfi.over-blog.com/2015/02/a-css-web-menu-on-vfp-form.html
This work is yet to broadcast the "good visual foxpro speech" all around the world foxers and make them 
accustomed with ,maybe the greatest extra class in visual foxpro: gdiplusX.
*12 september 2015--Added a vertical menu with glowingbutton class in the second code.


Click on code to select [then copy] -click outside to deselect


*1*
*Save as prg or select all , copy on command window and execute.
Clea All
Clea Resources
_Screen.WindowState=1
Declare Integer ReleaseCapture In WIN32API
Declare Integer SendMessage In WIN32API Integer, Integer, Integer, Integer

Local afile
Set Safe Off
afile=Addbs(Sys(2023))+"yglow.prg"
If File(m.afile)
    Erase (afile)
Endi

Set Textmerge On To (afile) Noshow
TEXT
*adapted from original class from Bernard Bout glowing button-can find on its blog in Foxite
DEFINE CLASS glowingbutton AS imgcanvas
	Height = 57
	MousePointer = 15
	Width = 164
	mouseover = .F.
	mouseisdown = .F.
	nfontcolour = 16760576
	nglowcolour = 16680760
	*-- Use this builder for setting props
	aglowbuilder = 0
	cfontname = "Arial"
	nfontsize = 24
	cbuttoncaption = "Click Me"
	issound = .T.
	rendermode = 4
	drawwheninvisible = .T.
	Name = "glowingbutton"

	PROCEDURE getpath
		LPARAMETERS rc,r,nCurvetype
		IF EMPTY(nCurvetype)
			nCurvetype = 0
		ENDIF
		* nCurvetype - 0 full curve, 1 top only, 2 bottom only
		LOCAL x,y,w,h,xpath,rx
		x = rc.X
		y = rc.Y
		w = rc.Width
		h = rc.Height
		rx = r
		ry=r
		DO case
		CASE nCurvetype = 1
			* top only
			rx = 1
		CASE nCurvetype = 2
			* bottom only
			ry = 1
		ENDCASE

		WITH _screen.system.Drawing
			xpath = .Drawing2D.GraphicsPath.New()
			xpath.AddArc(x, y, ry, ry, 180, 90)			&& Upper left corner
			xpath.AddArc(x+w - ry, y, ry, ry, 270, 90)		&&Upper right corner
			xpath.AddArc(x+w - rx, y+h - rx, rx, rx, 0, 90)	&&Lower right corner
			xpath.AddArc(x, y+h - rx, rx, rx, 90, 90)		&&Lower left corner
			xpath.CloseFigure()
		ENDWITH
		return xpath
	ENDPROC

	PROCEDURE drawhalotext
		Lparameters toHalocolour,tcFont,tnFontsize,toFontColour,tcText,tnLeft,tnTop,tlHalo
		With _Screen.System.Drawing
			* Create a GraphicsPath object.
			Local loPath As xfcGraphicsPath
			loPath = .Drawing2D.GraphicsPath.New()

			* Get a basic string format object, then set properties
			loStringFormat = .StringFormat.new()
			loStringFormat.Alignment = .StringAlignment.Center
			loStringFormat.LineAlignment =.StringAlignment.Center

			loPath.AddString(tcText, ;
					.FontFamily.New(tcFont), ;
					.FontStyle.Bold, ;
					tnFontsize, ;
					.Rectangle.New(tnLeft,tnTop,0.8*this.width,0.8*this.height),;
					loStringFormat)

			IF tlHalo
				* Create a bitmap in a fixed ratio to the original drawing area.
				Local loBmp As xfcBitmap
				toRect = This.Rectangle
				loBmp = .Bitmap.New(toRect.Width / 5, toRect.Height / 5)

				*.Point.New(0,0),
				* Get the graphics object for the image.
				Local logfx1 As xfcGraphics
				logfx1 = .Graphics.FromImage(loBmp)

				* Create a matrix that shrinks the drawing output by the fixed ratio.
				Local loMatrix As xfcMatrix
				loMatrix = .Drawing2D.Matrix.New(1/5, 0, 0, 1/5, -1/5, -1/5)

				* Choose an appropriate smoothing mode for the halo.
				logfx1.SmoothingMode = .Drawing2D.SmoothingMode.AntiAlias

				* Transform the graphics object so that the same half may be used for both halo and text output.
				logfx1.Transform = loMatrix

				* Using a suitable pen...
				Local loPen As xfcPen
				loPen = .Pen.New(toHalocolour)

				* Draw around the outline of the path
				logfx1.DrawPath(loPen, loPath)

				* and then fill in for good measure.
				logfx1.FillPath( .SolidBrush.New(toHalocolour), loPath)

				* setup the smoothing mode for path drawing
				This.oGfx.SmoothingMode = .Drawing2D.SmoothingMode.AntiAlias

				* and the interpolation mode for the expansion of the halo bitmap
				This.oGfx.InterpolationMode = .Drawing2D.InterpolationMode.HighQualityBicubic

				* expand the halo making the edges nice and fuzzy.
				This.oGfx.DrawImage(loBmp, toRect,0,0,loBmp.Width,loBmp.Height,.GraphicsUnit.Pixel)
			ENDIF
			* Redraw the original text
			This.oGfx.FillPath(.SolidBrush.New(toFontColour), loPath)
		Endwith
	ENDPROC

	PROCEDURE enabled_assign
		lparameters tuNewValue
		This.Enabled = tuNewValue
		This.Draw()
	ENDPROC

	PROCEDURE setup
		this.drawWheninvisible=.t.
		this.draw
	ENDPROC

	PROCEDURE Click
		if this.isSound=.t.
		TRY
							LOCAL lcBell
							lcBell = SET("Bell")
							SET BELL TO (ADDBS(GETENV('windir')))+"MEDIA\tada.WAV"
							?? CHR(7)
							SET BELL TO (lcBell)
						CATCH
		ENDTRY
		endi
	ENDPROC

	PROCEDURE MouseUp
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		IF This.Enabled
			This.mouseisdown  = .F.
			This.Draw
		ENDIF
	ENDPROC

	PROCEDURE MouseDown
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		IF This.Enabled
			This.mouseisdown  = .T.
			This.Draw
		ENDIF
	ENDPROC

	PROCEDURE MouseLeave
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		IF This.Enabled
			This.mouseover = .F.
			This.Draw
		ENDIF
	ENDPROC

	PROCEDURE MouseEnter
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		IF This.Enabled
			This.mouseover = .T.
			This.Draw
		ENDIF
	ENDPROC

	PROCEDURE beforedraw
		LOCAL logfx as xfcGraphics
		logfx = This.oGfx
		WITH _SCREEN.system.Drawing
			logfx.Clear(.Color.Transparent)
			loGfx.SmoothingMode = .Drawing2D.SmoothingMode.AntiAlias
			* gray outer
			loRect1 = .Rectangle.new(3,3,This.Width-6,This.Height-6)
			path1 = This.GetPath(loRect1, 20)
			loPen1 = .Pen.new(IIF(This.MouseisDown,.Color.black,.Color.gray),6)
			loGfx.DrawPath(loPen1,path1)
			* black inner
			loRect2 = lorect1
			lorect2.inflate(-1,-1)
			path2 = This.GetPath(loRect2, 20)
			loBrush1 = .SolidBrush.New(.Color.Black)
			loGfx.FillPath(loBrush1,Path2)
			* highlight
			loRect3 = .RectangleF.New(6,4,This.Width - 12, This.Height/2 - 2)
			path3 = This.getpath(lorect3,20)
			loBrush2 = .Drawing2D.LinearGradientBrush.new(loRect3,.Color.FromRGB(165,165,165),.Color.FromRGB(33,33,33),1)
			loGfx.FillPath(loBrush2,Path3)
			* text
			loHalocolour = .Color.FromRGB(This.nGlowColour)
			lcFont = This.cFontName
			lnFontsize = This.nFontSize
			loFontColour = 	IIF(This.Enabled,.Color.FromRGB(This.nFontColour),.Color.Gray)
			lcText = This.cButtonCaption
			lnLeft = this.width/10    &&2
			lnTop = This.Height/10     &&2
			This.drawhalotext(loHalocolour,lcFont,lnFontsize,loFontColour,lcText,lnLeft,lnTop,This.mouseover)
		ENDWITH
	ENDPROC
ENDDEFINE

ENDTEXT
Set Textmerge To
Set Safe On
****************************************
Set Classlib To Locfile("gdiplusX",'vcx') AddI
Set Proc To (afile) AddI
Publi yform
yform=Newobject("asup")
yform.Show
Release Proc (afile)
Release Classlib gdiplusx
Read Events
Return

Define Class asup As Form
	Top = 10
	Left = 67
	Height = 615
	Width = 860
	DoCreate = .T.
	Caption = "Form1"
	TitleBar=1
	Visible = .F.
	ShowWindow=2
	Name = "Form1"

	Add Object glowingbutton1 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 4, ;
		Top = 5, ;
		Width = 164, ;
		nfontcolour = 16760576, ;
		nglowcolour = 16680760, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton1"

	Add Object glowingbutton2 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 173, ;
		Top = 6, ;
		Width = 164, ;
		nfontcolour = 51200, ;
		nglowcolour = 65408, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton2"

	Add Object glowingbutton3 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 4, ;
		Top = 69, ;
		Width = 164, ;
		nfontcolour = 592383, ;
		nglowcolour = 33023, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton3"

	Add Object glowingbutton4 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 173, ;
		Top = 70, ;
		Width = 164, ;
		nfontcolour = 43176, ;
		nglowcolour = 12058623, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton4"

	Add Object glowingbutton5 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 4, ;
		Top = 133, ;
		Width = 164, ;
		nfontcolour = 16722068, ;
		nglowcolour = 16744576, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton5"

	Add Object glowingbutton6 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 173, ;
		Top = 132, ;
		Width = 164, ;
		nfontcolour = 16776960, ;
		nglowcolour = 16711680, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton6"

	Add Object glowingbutton7 As glowingbutton With ;
		Picture = "", ;
		Enabled = .F., ;
		Height = 57, ;
		Left = 4, ;
		Top = 197, ;
		Width = 164, ;
		nfontcolour = 10395294, ;
		nglowcolour = 16711680, ;
		cbuttoncaption = "I Am Disabled", ;
		cfontname = "Arial", ;
		nfontsize =         20.00, ;
		Name = "Glowingbutton7"

	Add Object glowingbutton8 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 173, ;
		Top = 195, ;
		Width = 56, ;
		nfontcolour = 12303359, ;
		nglowcolour = 255, ;
		cbuttoncaption = "1"                                    , ;
		cfontname = "Wingdings", ;
		nfontsize =         24.00, ;
		Name = "Glowingbutton8"

	Add Object glowingbutton9 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 281, ;
		Top = 195, ;
		Width = 56, ;
		nfontcolour = 12303359, ;
		nglowcolour = 255, ;
		cbuttoncaption = '2', ;
		cfontname = "Wingdings", ;
		nfontsize =         24.00, ;
		Name = "Glowingbutton9"

	Add Object glowingbutton10 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 347, ;
		Top = 6, ;
		Width = 164, ;
		nfontcolour = 16760576, ;
		nglowcolour = 16680760, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton10"

	Add Object glowingbutton11 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 516, ;
		Top = 7, ;
		Width = 164, ;
		nfontcolour = 51200, ;
		nglowcolour = 65408, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton11"

	Add Object glowingbutton12 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 347, ;
		Top = 70, ;
		Width = 164, ;
		nfontcolour = 592383, ;
		nglowcolour = 33023, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton12"

	Add Object glowingbutton13 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 516, ;
		Top = 71, ;
		Width = 164, ;
		nfontcolour = 43176, ;
		nglowcolour = 12058623, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton13"

	Add Object glowingbutton14 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 347, ;
		Top = 134, ;
		Width = 164, ;
		nfontcolour = 16722068, ;
		nglowcolour = 16744576, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton14"

	Add Object glowingbutton15 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 516, ;
		Top = 133, ;
		Width = 164, ;
		nfontcolour = 16776960, ;
		nglowcolour = 16711680, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton15"

	Add Object glowingbutton16 As glowingbutton With ;
		Picture = "", ;
		Enabled = .F., ;
		Height = 57, ;
		Left = 347, ;
		Top = 198, ;
		Width = 164, ;
		nfontcolour = 10395294, ;
		nglowcolour = 16711680, ;
		cbuttoncaption = "I Am Disabled", ;
		cfontname = "Arial", ;
		nfontsize =         20.00, ;
		Name = "Glowingbutton16"

	Add Object glowingbutton17 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 516, ;
		Top = 196, ;
		Width = 56, ;
		nfontcolour = 12303359, ;
		nglowcolour = 255, ;
		cbuttoncaption = '3'                                    , ;
		cfontname = "Wingdings", ;
		nfontsize =         24.00, ;
		Name = "Glowingbutton17"

	Add Object glowingbutton18 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 624, ;
		Top = 196, ;
		Width = 56, ;
		nfontcolour = 12303359, ;
		nglowcolour = 255, ;
		cbuttoncaption = "4", ;
		cfontname = "Wingdings", ;
		nfontsize =         24.00, ;
		Name = "Glowingbutton18"

	Add Object glowingbutton19 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 4, ;
		Top = 257, ;
		Width = 164, ;
		nfontcolour = 16760576, ;
		nglowcolour = 16680760, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton19"

	Add Object glowingbutton20 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 175, ;
		Top = 258, ;
		Width = 164, ;
		nfontcolour = 51200, ;
		nglowcolour = 65408, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton20"


	Add Object glowingbutton21 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 4, ;
		Top = 321, ;
		Width = 164, ;
		nfontcolour = 592383, ;
		nglowcolour = 33023, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton21"

	Add Object glowingbutton22 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 175, ;
		Top = 322, ;
		Width = 164, ;
		nfontcolour = 43176, ;
		nglowcolour = 12058623, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton22"

	Add Object glowingbutton23 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 4, ;
		Top = 385, ;
		Width = 164, ;
		nfontcolour = 16722068, ;
		nglowcolour = 16744576, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton23"


	Add Object glowingbutton24 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 175, ;
		Top = 384, ;
		Width = 164, ;
		nfontcolour = 16776960, ;
		nglowcolour = 16711680, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton24"

	Add Object glowingbutton25 As glowingbutton With ;
		Picture = "", ;
		Enabled = .F., ;
		Height = 57, ;
		Left = 4, ;
		Top = 449, ;
		Width = 164, ;
		nfontcolour = 10395294, ;
		nglowcolour = 16711680, ;
		cbuttoncaption = "I Am Disabled", ;
		cfontname = "Arial", ;
		nfontsize =         20.00, ;
		Name = "Glowingbutton25"

	Add Object glowingbutton26 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 175, ;
		Top = 447, ;
		Width = 56, ;
		nfontcolour = 12303359, ;
		nglowcolour = 255, ;
		cbuttoncaption ="5"                                 , ;
		cfontname = "Wingdings", ;
		nfontsize =         24.00, ;
		Name = "Glowingbutton26"


	Add Object glowingbutton27 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 283, ;
		Top = 447, ;
		Width = 56, ;
		nfontcolour = 12303359, ;
		nglowcolour = 255, ;
		cbuttoncaption = "6", ;
		cfontname = "Wingdings", ;
		nfontsize =         24.00, ;
		Name = "Glowingbutton27"

	Add Object glowingbutton28 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 347, ;
		Top = 259, ;
		Width = 164, ;
		nfontcolour = 16760576, ;
		nglowcolour = 16680760, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton28"

	Add Object glowingbutton29 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 516, ;
		Top = 260, ;
		Width = 164, ;
		nfontcolour = 51200, ;
		nglowcolour = 65408, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton29"

	Add Object glowingbutton30 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 347, ;
		Top = 323, ;
		Width = 164, ;
		nfontcolour = 592383, ;
		nglowcolour = 33023, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton30"

	Add Object glowingbutton31 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 516, ;
		Top = 324, ;
		Width = 164, ;
		nfontcolour = 43176, ;
		nglowcolour = 12058623, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton31"

	Add Object glowingbutton32 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 347, ;
		Top = 387, ;
		Width = 164, ;
		nfontcolour = 16722068, ;
		nglowcolour = 16744576, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton32"

	Add Object glowingbutton33 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 516, ;
		Top = 386, ;
		Width = 164, ;
		nfontcolour = 16776960, ;
		nglowcolour = 16711680, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton33"

	Add Object glowingbutton34 As glowingbutton With ;
		Picture = "", ;
		Enabled = .F., ;
		Height = 57, ;
		Left = 347, ;
		Top = 451, ;
		Width = 164, ;
		nfontcolour = 10395294, ;
		nglowcolour = 16711680, ;
		cbuttoncaption = "I Am Disabled", ;
		cfontname = "Arial", ;
		nfontsize =         20.00, ;
		Name = "Glowingbutton34"

	Add Object glowingbutton35 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 516, ;
		Top = 449, ;
		Width = 56, ;
		nfontcolour = 12303359, ;
		nglowcolour = 255, ;
		cbuttoncaption = "7"                                    , ;
		cfontname = "Wingdings", ;
		nfontsize =         24.00, ;
		Name = "Glowingbutton35"

	Add Object glowingbutton36 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 624, ;
		Top = 449, ;
		Width = 56, ;
		nfontcolour = 12303359, ;
		nglowcolour = 255, ;
		cbuttoncaption ="8", ;
		cfontname = "Wingdings", ;
		nfontsize =         24.00, ;
		Name = "Glowingbutton36"

	Add Object glowingbutton37 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 684, ;
		Top = 7, ;
		Width = 164, ;
		nfontcolour = 16760576, ;
		nglowcolour = 16680760, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton37"

	Add Object glowingbutton38 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 684, ;
		Top = 71, ;
		Width = 164, ;
		nfontcolour = 592383, ;
		nglowcolour = 33023, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton38"

	Add Object glowingbutton39 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 684, ;
		Top = 135, ;
		Width = 164, ;
		nfontcolour = 16722068, ;
		nglowcolour = 16744576, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton39"

	Add Object glowingbutton40 As glowingbutton With ;
		Picture = "", ;
		Enabled = .F., ;
		Height = 57, ;
		Left = 684, ;
		Top = 199, ;
		Width = 164, ;
		nfontcolour = 10395294, ;
		nglowcolour = 16711680, ;
		cbuttoncaption = "I Am Disabled", ;
		cfontname = "Arial", ;
		nfontsize =         20.00, ;
		Name = "Glowingbutton40"

	Add Object glowingbutton41 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 684, ;
		Top = 259, ;
		Width = 164, ;
		nfontcolour = 16760576, ;
		nglowcolour = 16680760, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton41"

	Add Object glowingbutton42 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 684, ;
		Top = 323, ;
		Width = 164, ;
		nfontcolour = 592383, ;
		nglowcolour = 33023, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton42"

	Add Object glowingbutton43 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 684, ;
		Top = 387, ;
		Width = 164, ;
		nfontcolour = 16722068, ;
		nglowcolour = 16744576, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton43"



	Add Object glowingbutton44 As glowingbutton With ;
		Picture = "", ;
		Enabled = .F., ;
		Height = 57, ;
		Left = 684, ;
		Top = 451, ;
		Width = 164, ;
		nfontcolour = 10395294, ;
		nglowcolour = 16711680, ;
		cbuttoncaption = "I Am Disabled", ;
		cfontname = "Arial", ;
		nfontsize =         20.00, ;
		Name = "Glowingbutton44"

	Add Object glowingbutton45 As glowingbutton With ;
    	Picture = "", ;
		Height = 57, ;
		Left = 10, ;
		Top = 520, ;
		Width = 600, ;
		nfontcolour = Rgb(0,255,0), ;
		nglowcolour = 16744576, ;
		cbuttoncaption = "Summary Help", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton45"
	
	Add Object glowingbutton46 As glowingbutton With ;
		Picture = "", ;
		Height = 60, ;
		Left = 720, ;
		Top = 520, ;
		Width = 60, ;
		nfontcolour = Rgb(0,255,0),;
		nglowcolour = 16744576, ;
		cbuttoncaption = "Close", ;
		cfontname = "Arial", ;
		nfontsize = 12, ;
		Name = "Glowingbutton46"

	Add Object label1 As Label With ;
		Height = 20, ;
		Left = 5, ;
		Top = 590, ;
		Width =700, ;
		fontbold=.T.,;
		fontname="Arial",;
		fontsize=14,;
		alignment=2,;
		forecolor=255,;
		caption="",;
		Name = "label1"

	Add Object timer1 As Timer With ;
		Top = 468, ;
		Left = 252, ;
		Height = 23, ;
		Width = 23, ;
		Enabled = .F., ;
		Interval = 500, ;
		Name = "Timer1"


	Procedure Init
	With  Thisform
		.TitleBar=0
		For i=1 To .ControlCount
			If Lower(.Controls(i).Class)=="glowingbutton"
				Bindevent(.Controls(i),"mousedown",Thisform,"my")
			Endi
		Endfor
	Endwith
    thisform.timer1.enabled=.t.
	Endproc

	Procedure timer1.Timer
	Thisform.SetAll("visible",.T.,"glowingbutton")
	This.Enabled=.F.
	Endproc

	Procedure glowingbutton46.Click
	Thisform.Release
	Endproc

	Procedure MouseDown
	Lparameters nButton, nShift, nXCoord, nYCoord
	Thisform.MousePointer=15
	lnHandle = Thisform.HWnd
	param1 = 274
	param2 = 0xF012
	bb=ReleaseCapture()
	bb=SendMessage(lnHandle, param1, param2,0)
	Thisform.MousePointer=0
	Endproc

	Procedure my
	Lparameters nButton, nShift, nXCoord, nYCoord
*--- aevent create an array laEvents
	Aevents( myArray, 0)
*--- reference the calling object
	loObject = myArray[1]
	Thisform.label1.Caption=""
    if  Lower(loObject.Name)=="glowingbutton45"
    thisform.yhelp()
	endi
	If ! Lower(loObject.Name)=="glowingbutton46"
		Thisform.label1.ForeColor=Rgb(255*Rand(),255*Rand(),255*Rand())
		Thisform.label1.Caption=loObject.Name+" clicked....can make any action from the method [my]"
	Endi
	Endproc
    
    procedure yhelp()
    local m.myvar 
	text to m.myvar noshow
this is a demo for a glowingButton class ,original author Bernard Bout Brisbane ,Australia www.foxite.com (thanks).
it was presented with another method as a single prg.I published it in foxite a while ago.
The code ask simply point mandatory to the gdiplusX class to make the code working.
its draws a large  variety of glowing buttons with some events....(see the photo below)
buttons have same 2 colors derived from black (see beforeDraw method).
the form is movable by mousedown event.
In the method "my" used by bindevent you can put any custom code for any button to fire any action.
The buttons can be arranged otherwise the choosed on form (horizontally or vertically to simulate a 
real menu.can put them in a container...
This work is yet to broadcast the "good visual foxpro speech" all around the world foxers and make them 
accustomed with ,maybe the greatest class in visual foxpro: gdiplusX.
endtext
messagebox(m.myvar,0+32+4096,"Summary help")	
	endproc


	Procedure Destroy
    dele file m.afile  &&clean
	Clea Events
	Endproc

Enddefine



if you want to build a project:

- make this prg as the main code (add at top :on shutdown quit)
-cut locfile(..)  statement and put gdiplusX.vcx (vct) in your proj folder.its added automatically to the project.
-add in the main prg : do system.app (put system.app in your proj folder)
-add a config.fpw (screen=off   resource=off)
-add the file system.drawing.h  
-can then compile an exe.

GdiplusX Glowing buttons revisited
GdiplusX Glowing buttons revisited

Click on code to select [then copy] -click outside to deselect


*2*
*Added september 12 2015
*build a vertical menu with glowing gdiplusX buttons.the form is expandable/collapsable.

*Save as prg or select all , copy on command window and execute.
Clea All
Clea Resources
_Screen.WindowState=1
Declare Integer ReleaseCapture In WIN32API
Declare Integer SendMessage In WIN32API Integer, Integer, Integer, Integer

Local afile
Set Safe Off
afile=Addbs(Sys(2023))+"yglow.prg"
If File(m.afile)
    Erase (afile)
Endi

Set Textmerge On To (afile) Noshow  &&creating a temp file as prg class
TEXT
*adapted from original class from Bernard Bout glowing button-can find on its blog in Foxite
DEFINE CLASS glowingbutton AS imgcanvas
	Height = 57
	MousePointer = 15
	Width = 164
	mouseover = .F.
	mouseisdown = .F.
	nfontcolour = 16760576
	nglowcolour = 16680760
	*-- Use this builder for setting props
	aglowbuilder = 0
	cfontname = "Arial"
	nfontsize = 24
	cbuttoncaption = "Click Me"
	issound = .T.
	rendermode = 4
	drawwheninvisible = .T.
	Name = "glowingbutton"

	PROCEDURE getpath
		LPARAMETERS rc,r,nCurvetype
		IF EMPTY(nCurvetype)
			nCurvetype = 0
		ENDIF
		* nCurvetype - 0 full curve, 1 top only, 2 bottom only
		LOCAL x,y,w,h,xpath,rx
		x = rc.X
		y = rc.Y
		w = rc.Width
		h = rc.Height
		rx = r
		ry=r
		DO case
		CASE nCurvetype = 1
			* top only
			rx = 1
		CASE nCurvetype = 2
			* bottom only
			ry = 1
		ENDCASE

		WITH _screen.system.Drawing
			xpath = .Drawing2D.GraphicsPath.New()
			xpath.AddArc(x, y, ry, ry, 180, 90)			&& Upper left corner
			xpath.AddArc(x+w - ry, y, ry, ry, 270, 90)		&&Upper right corner
			xpath.AddArc(x+w - rx, y+h - rx, rx, rx, 0, 90)	&&Lower right corner
			xpath.AddArc(x, y+h - rx, rx, rx, 90, 90)		&&Lower left corner
			xpath.CloseFigure()
		ENDWITH
		return xpath
	ENDPROC

	PROCEDURE drawhalotext
		Lparameters toHalocolour,tcFont,tnFontsize,toFontColour,tcText,tnLeft,tnTop,tlHalo
		With _Screen.System.Drawing
			* Create a GraphicsPath object.
			Local loPath As xfcGraphicsPath
			loPath = .Drawing2D.GraphicsPath.New()

			* Get a basic string format object, then set properties
			loStringFormat = .StringFormat.new()
			loStringFormat.Alignment = .StringAlignment.Center
			loStringFormat.LineAlignment =.StringAlignment.Center

			loPath.AddString(tcText, ;
					.FontFamily.New(tcFont), ;
					.FontStyle.Bold, ;
					tnFontsize, ;
					.Rectangle.New(tnLeft,tnTop,0.8*this.width,0.8*this.height),;
					loStringFormat)

			IF tlHalo
				* Create a bitmap in a fixed ratio to the original drawing area.
				Local loBmp As xfcBitmap
				toRect = This.Rectangle
				loBmp = .Bitmap.New(toRect.Width / 5, toRect.Height / 5)

				*.Point.New(0,0),
				* Get the graphics object for the image.
				Local logfx1 As xfcGraphics
				logfx1 = .Graphics.FromImage(loBmp)

				* Create a matrix that shrinks the drawing output by the fixed ratio.
				Local loMatrix As xfcMatrix
				loMatrix = .Drawing2D.Matrix.New(1/5, 0, 0, 1/5, -1/5, -1/5)

				* Choose an appropriate smoothing mode for the halo.
				logfx1.SmoothingMode = .Drawing2D.SmoothingMode.AntiAlias

				* Transform the graphics object so that the same half may be used for both halo and text output.
				logfx1.Transform = loMatrix

				* Using a suitable pen...
				Local loPen As xfcPen
				loPen = .Pen.New(toHalocolour)

				* Draw around the outline of the path
				logfx1.DrawPath(loPen, loPath)

				* and then fill in for good measure.
				logfx1.FillPath( .SolidBrush.New(toHalocolour), loPath)

				* setup the smoothing mode for path drawing
				This.oGfx.SmoothingMode = .Drawing2D.SmoothingMode.AntiAlias

				* and the interpolation mode for the expansion of the halo bitmap
				This.oGfx.InterpolationMode = .Drawing2D.InterpolationMode.HighQualityBicubic

				* expand the halo making the edges nice and fuzzy.
				This.oGfx.DrawImage(loBmp, toRect,0,0,loBmp.Width,loBmp.Height,.GraphicsUnit.Pixel)
			ENDIF
			* Redraw the original text
			This.oGfx.FillPath(.SolidBrush.New(toFontColour), loPath)
		Endwith
	ENDPROC

	PROCEDURE enabled_assign
		lparameters tuNewValue
		This.Enabled = tuNewValue
		This.Draw()
	ENDPROC

	PROCEDURE setup
		this.drawWheninvisible=.t.
		this.draw
	ENDPROC

	PROCEDURE Click
		if this.isSound=.t.
		TRY
							LOCAL lcBell
							lcBell = SET("Bell")
							SET BELL TO (ADDBS(GETENV('windir')))+"MEDIA\tada.WAV"
							?? CHR(7)
							SET BELL TO (lcBell)
						CATCH
		ENDTRY
		endi
	ENDPROC

	PROCEDURE MouseUp
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		IF This.Enabled
			This.mouseisdown  = .F.
			This.Draw
		ENDIF
	ENDPROC

	PROCEDURE MouseDown
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		IF This.Enabled
			This.mouseisdown  = .T.
			This.Draw
		ENDIF
	ENDPROC

	PROCEDURE MouseLeave
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		IF This.Enabled
			This.mouseover = .F.
			This.Draw
		ENDIF
	ENDPROC

	PROCEDURE MouseEnter
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		IF This.Enabled
			This.mouseover = .T.
			This.Draw
		ENDIF
	ENDPROC

	PROCEDURE beforedraw
		LOCAL logfx as xfcGraphics
		logfx = This.oGfx
		WITH _SCREEN.system.Drawing
			logfx.Clear(.Color.Transparent)
			loGfx.SmoothingMode = .Drawing2D.SmoothingMode.AntiAlias
			* gray outer
			loRect1 = .Rectangle.new(3,3,This.Width-6,This.Height-6)
			path1 = This.GetPath(loRect1, 20)
			loPen1 = .Pen.new(IIF(This.MouseisDown,.Color.black,.Color.gray),6)
			loGfx.DrawPath(loPen1,path1)
			* black inner
			loRect2 = lorect1
			lorect2.inflate(-1,-1)
			path2 = This.GetPath(loRect2, 20)
			loBrush1 = .SolidBrush.New(.Color.Black)
			loGfx.FillPath(loBrush1,Path2)
			* highlight
			loRect3 = .RectangleF.New(6,4,This.Width - 12, This.Height/2 - 2)
			path3 = This.getpath(lorect3,20)
			loBrush2 = .Drawing2D.LinearGradientBrush.new(loRect3,.Color.FromRGB(165,165,165),.Color.FromRGB(33,33,33),1)
			loGfx.FillPath(loBrush2,Path3)
			* text
			loHalocolour = .Color.FromRGB(This.nGlowColour)
			lcFont = This.cFontName
			lnFontsize = This.nFontSize
			loFontColour = 	IIF(This.Enabled,.Color.FromRGB(This.nFontColour),.Color.Gray)
			lcText = This.cButtonCaption
			lnLeft = this.width/10    &&2
			lnTop = This.Height/10     &&2
			This.drawhalotext(loHalocolour,lcFont,lnFontsize,loFontColour,lcText,lnLeft,lnTop,This.mouseover)
		ENDWITH
	ENDPROC
ENDDEFINE

ENDTEXT
Set Textmerge To
Set Safe On
****************************************
Set Classlib To Locfile("gdiplusX",'vcx') AddI
Set Proc To (afile) AddI
Publi yform
yform=Newobject("asup")
yform.Show
Release Proc (afile)
Release Classlib gdiplusx
Read Events
Return

Define Class asup As Form
	Top = 10
	Left = 67
	Height = 650
	Width = 175
	Showtips = .T.
	Caption = "Form1"
	TitleBar=1
	Visible = .F.
	ShowWindow=2
	backcolor=rgb(255,201,14)
	Name = "Form1"

	Add Object  label1 As Label With ;
		top=0 ,;
		left=70,;
		autosize=.T.,;
		backstyle=0,;
		fontname="webdings",;
		fontsize=20,;
		caption="4",;
		forecolor=255,;
		mousepointer=15,;
		tooltiptext="Expand/collapse form"
		name="label1"



	Add Object glowingbutton1 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 4, ;
		Top = 25, ;
		Width = 164, ;
		nfontcolour = 16760576, ;
		nglowcolour = 16680760, ;
		cbuttoncaption = "Notepad", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton1"

	Add Object glowingbutton2 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 173, ;
		Top = 6, ;
		Width = 164, ;
		nfontcolour = 51200, ;
		nglowcolour = 65408, ;
		cbuttoncaption = "MsPaint", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton2"

	Add Object glowingbutton3 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 4, ;
		Top = 69, ;
		Width = 164, ;
		nfontcolour = 592383, ;
		nglowcolour = 33023, ;
		cbuttoncaption = "Set time", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton3"

	Add Object glowingbutton4 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 173, ;
		Top = 70, ;
		Width = 164, ;
		nfontcolour = 43176, ;
		nglowcolour = 12058623, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton4"

	Add Object glowingbutton5 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 4, ;
		Top = 133, ;
		Width = 164, ;
		nfontcolour = 16722068, ;
		nglowcolour = 16744576, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton5"

	Add Object glowingbutton6 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 173, ;
		Top = 132, ;
		Width = 164, ;
		nfontcolour = 16776960, ;
		nglowcolour = 16711680, ;
		cbuttoncaption = "Click Me", ;
		cfontname = "Arial", ;
		nfontsize = 24, ;
		Name = "Glowingbutton6"

	Add Object glowingbutton7 As glowingbutton With ;
		Picture = "", ;
		Enabled = .F., ;
		Height = 57, ;
		Left = 4, ;
		Top = 197, ;
		Width = 164, ;
		nfontcolour = 10395294, ;
		nglowcolour = 16711680, ;
		cbuttoncaption = "I Am Disabled", ;
		cfontname = "Arial", ;
		nfontsize =         20.00, ;
		Name = "Glowingbutton7"

	Add Object glowingbutton8 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 173, ;
		Top = 195, ;
		Width = 164, ;
		nfontcolour = 12303359, ;
		nglowcolour = 255, ;
		cbuttoncaption = "1"                                    , ;
		cfontname = "Wingdings", ;
		nfontsize =         24.00, ;
		Name = "Glowingbutton8"

	Add Object glowingbutton9 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 281, ;
		Top = 195, ;
		Width = 164, ;
		nfontcolour = 12303359, ;
		nglowcolour = 255, ;
		cbuttoncaption = '2', ;
		cfontname = "Wingdings", ;
		nfontsize =         24.00, ;
		Name = "Glowingbutton9"

	Add Object glowingbutton11 As glowingbutton With ;
		Picture = "", ;
		Enabled = .F., ;
		Height = 57, ;
		Left = 684, ;
		Top = 451, ;
		Width = 164, ;
		nfontcolour = 10395294, ;
		nglowcolour = 16711680, ;
		cbuttoncaption = "I Am Disabled", ;
		cfontname = "Arial", ;
		nfontsize =         20.00, ;
		Name = "Glowingbutton11"

	Add Object glowingbutton12 As glowingbutton With ;
		Picture = "", ;
		Height = 57, ;
		Left = 10, ;
		Top = 520, ;
		Width = 164, ;
		nfontcolour = Rgb(0,255,0), ;
		nglowcolour = 16744576, ;
		cbuttoncaption = "Summary Help", ;
		cfontname = "Arial", ;
		nfontsize = 20, ;
		Name = "Glowingbutton12"

	Add Object glowingbutton13 As glowingbutton With ;
		Picture = "", ;
		Height = 60, ;
		Left = 720, ;
		Top = 520, ;
		Width = 164, ;
		nfontcolour = Rgb(0,255,0),;
		nglowcolour = 16744576, ;
		cbuttoncaption = "Close", ;
		cfontname = "Arial", ;
		nfontsize = 12, ;
		Name = "Glowingbutton13"

	Add Object  yed As EditBox With ;
		top=50 ,;
		left=200,;
		width=400,;
		height=400,;
		fontname="Batavia",;
		fontsize=20,;
		forecolor=Rgb(155,178,0),;
		name="yed"


	Add Object timer1 As Timer With ;
		Top = 468, ;
		Left = 252, ;
		Height = 23, ;
		Width = 23, ;
		Enabled = .F., ;
		Interval = 800, ;
		Name = "Timer1"

	Procedure Init
	With  Thisform
		.TitleBar=0
		.SetAll("width",164  ,"Glowingbutton")
		.SetAll("height",50 ,"Glowingbutton")

		For i=1 To .ControlCount
			If Lower(.Controls(i).Class)=="glowingbutton"
				.Controls(i).Left=4
				If i>1 And  Lower(.Controls(i-1).Class)=="glowingbutton"
					.Controls(i).Top=.Controls(i-1).Top+.Controls(i-1).Height+2
				Endi
				Bindevent(.Controls(i),"mousedown",Thisform,"my")
			Endi
		Endfor
		.timer1.Enabled=.T.
	Endwith
	Endproc

	Procedure timer1.Timer
	Thisform.SetAll("visible",.T.,"glowingbutton")
	This.Enabled=.F.

	Endproc


	Procedure MouseDown
	Lparameters nButton, nShift, nXCoord, nYCoord
	Thisform.MousePointer=15
	lnHandle = Thisform.HWnd
	param1 = 274
	param2 = 0xF012
	bb=ReleaseCapture()
	bb=SendMessage(lnHandle, param1, param2,0)
	Thisform.MousePointer=0
	Endproc

	Procedure my
	Lparameters nButton, nShift, nXCoord, nYCoord
	*--- aevent create an array laEvents
	Aevents( myArray, 0)
	*--- reference the calling object
	loObject = myArray[1]

	Do Case
	Case   Lower(loObject.Name)=="glowingbutton12"
		Thisform.yhelp()

	Case Lower(loObject.Name)=="glowingbutton13"
		Thisform.Release

	Case Lower(loObject.Name)=="glowingbutton1"
		Run/N notepad
	Case Lower(loObject.Name)=="glowingbutton2"
		Run/N mspaint
   Case Lower(loObject.Name)=="glowingbutton3"
   local oshell
   oshell=newObject("shell.application")
   oShell.SetTime
   oshell=null



	Otherwise

		If Thisform.label1.Caption="4"
			Wait Window (loObject.Name+" clicked....can make any action from the method [my] .") Nowait
		Else
			Thisform.yed.ForeColor=Rgb(255*Rand(),255*Rand(),255*Rand())
			Thisform.yed.Value=loObject.Name+" clicked....can make any action from the method [my] ."
		Endi
	Endcase


	Endproc

	Procedure yhelp()
	Local m.myvar
	TEXT to m.myvar noshow
this is a demo for a glowingButton class ,original author Bernard Bout Brisbane ,Australia www.foxite.com (thanks).
it was presented with another method as a single prg.I published it in foxite a while ago.
The code ask simply point mandatory to the gdiplusX class to make the code working.
its draws a large  variety of glowing buttons with some events....(see the photo below)
buttons have same 2 colors derived from black (see beforeDraw method).
the form is movable by mousedown event.
In the method "my" used by bindevent you can put any custom code for any button to fire any action.
The buttons can be arranged otherwise the choosed on form (horizontally or vertically to simulate a
real menu.can put them in a container...
This work is yet to broadcast the "good visual foxpro speech" all around the world foxers and make them
accustomed with ,maybe the greatest class in visual foxpro: gdiplusX.
	ENDTEXT
	Messagebox(m.myvar,0+32+4096,"Summary help")
	Endproc

	Procedure KeyPress
	Lparameters nKeyCode, nShiftAltCtrl
	If nKeyCode=27
		Thisform.Release
	Endi
	Procedure label1.Click
	This.Caption=Iif(This.Caption="4","3","4")

	If This.Caption="3"
		Thisform.Width=900
	Else
		Thisform.Width=175
	Endi

	Endproc

	Procedure Destroy
	Dele File m.afile  &&clean
	Clea Events
	Endproc

Enddefine





GdiplusX Glowing buttons revisited
GdiplusX Glowing buttons revisited
GdiplusX Glowing buttons revisited
 
*Important:*the code above is tested on visual foxpro 9 sp2-under windows 10 pro

To be informed of the latest articles, subscribe:
Comment on this post

angel dario rodrigiez 09/11/2015 17:35

It returns an error when I run it. Class definition GlowingButton does not exist.

Yousfi Benameur 09/11/2015 19:09

You must point in the dialog fired box to the gdiplusX.vcx class otherwise that dont work .if you dont have it download it from the vfpx codeplex https://vfpx.codeplex.com/wikipage?title=GDIPlusX&referringTitle=Home (complet project with gdiplusX class,system.app...).the result obtained is on demo images in article.note that glowingbutton class is based on imgcanvas control of gdiplusX.vcx.Good luck!