Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Border Color
Message
From
03/10/2018 07:18:38
 
 
To
03/10/2018 05:06:40
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01662372
Message ID:
01662451
Views:
34
>Koen
>I have always answer you above:
>-SCroll horizontally until the middle of window (slowly) because the string is too long.
>-the base64 picture i attached in a string builds the picture yb.png (redimesioned/attached) in your source folder (where you run the code).i you run a selection you can find it in temp folder (sys(2023)).preferably run the code pasted in a prg.
>however the blue button can provide any picture of your choice to put as container.picture- it is not by "mistake" as you affirm.
>nb:the picture is too small and i cannot attach it .
>
>resize method:try your suggestion...in principe anchor=15 is suffisent here (its already in code) but it position object initially and mandatory.
Yousfi,

The answer is still unsatisfactory to me.
It realy seems the picture does not serve to anything. when I delete the code from your code the form still runs, moreover the picture, this gradient imgae is never anywhere addressed in your code.
Please try this variant on you code: which works fine:
**!* GridwithborderByYousfi - variant without resize method and without the picture
Public oform
oform1=Newobject("ygrid_border_color")
oform1.Show
Read Events
Return

*
Define Class ygrid_border_color As Form
	Height = 296+40
	Width = 700
	ShowWindow = 2
	AutoCenter = .T.
	ShowTips=.T.
	ScaleMode=3
	Caption = "Click shapes to change random color, pîcture or container borderWidth.can resize the form/grid"
	Name = "Form1"

	Add Object container1 As ycont With ;
		Anchor = 15, ;
		Top = 12, ;
		Left = 30, ;
		Width = 655, ;
		Height = 265, ;
		BackStyle = 0, ;
		BorderWidth = 4, ;
		MousePointer = 15, ;
		BorderColor = Rgb(255,128,64), ;
		Name = "Container1"

	Add Object shape1 As Shape With ;
		Top = 300+14, ;
		Left = 50, ;
		Height = 13, ;
		Width = 13, ;
		Anchor = 768, ;
		Curvature = 99, ;
		MousePointer = 15, ;
		ToolTipText = "Change random border  color (or click on container border)", ;
		BackColor = Rgb(255,0,0), ;
		Name = "Shape1"

	Add Object shape2 As Shape With ;
		Top = 300+14, ;
		Left = 70, ;
		Height = 13, ;
		Width = 13, ;
		Anchor = 768, ;
		Curvature = 99, ;
		MousePointer = 15, ;
		ToolTipText = "Change container picture(empty=no picture)", ;
		BackColor = Rgb(0,0,255), ;
		Name = "Shape2"

	Add Object spinner1 As Spinner With ;
		Height = 24,;
		KeyboardHighValue = 20,;
		KeyboardLowValue = 0,;
		Left = 90,;
		SpinnerHighValue =  20.00,;
		SpinnerLowValue =   0.00,;
		Top = 295+14,;
		Width = 48,;
		Anchor=768,;
		Value=4,;
		ToolTipText="container borderwidth (px)",;
		Name = "Spinner1"

	Procedure shape1.Click
		Rand(-1)
		Thisform.container1.BorderColor=Rgb(255*Rand(),255*Rand(),255*Rand())
	Endproc

	Procedure shape2.Click
		With Thisform.container1
			.Picture=Getpict()
			.BackStyle=1
			Thisform.Resize()
		Endwith
	Endproc


	Procedure spinner1.InteractiveChange
		With Thisform.container1
			.BorderWidth= This.Value
			.Parent.Resize()
		Endwith
	Endproc

	Procedure Load
		Close Data All
		Sele * From Home(1)+"samples\data\customer"  Into Cursor ycurs Readwrite
		Sele ycurs
	Endproc

	Procedure Destroy
		Clea Events
	Endproc

Enddefine
*
*-- EndDefine: ygrid_border_color
***********************************
*
Define Class ycont As Container
	Anchor = 15
	Top = 12
	Left = 10
	Width = 655
	Height = 265
	BackStyle = 0
	BorderWidth = 4
	MousePointer = 15
	BorderColor = Rgb(255,128,64)
	Name = "Container1"

	Add Object grid1 As Grid With ;
		Anchor = 15, ;
		Height = 193, ;
		Left = 13, ;
		Top = 14, ;
		Width = 543, ;
		Name = "Grid1"

	Procedure Click
		Rand(-1)
		This.BorderColor=Rgb(255*Rand(),255*Rand(),255*Rand())
	Endproc

	Procedure grid1.Init
		With This
			.RecordSource="ycurs"
			.RecordSourceType=1
			.DeleteMark=.F.
			.RecordMark=.F.
			.HighlightStyle=2
			.GridLines=0
			.FontSize=11
			.FontName="Courier new"
			.SetAll("DynamicBackColor",  "IIF(MOD(RECNO(), 2) = 0, RGB(255, 255, 255), RGB(255, 255, 190) )","column")
			.Refresh
		Endwith
	Endproc


Enddefine
*
*-- EndDefine: ycont
***********************
Regards,

Koen
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform