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

How to show an alternate label in my grid 1

Status
Not open for further replies.

Koen Piller

Programmer
Jun 30, 2005
841
0
0
NL
Hi,

This is more or less the same as my question in Thread 184-896484.
I would like to show in my grid in field Sale alternate a label with SOLD or a label with nothing.
So I followed Mike's advise in Thread 184-896484 and
created 2 labels lblSold with text and lblStock without any text
The controlSource for Column17 is Artikele.Verkocht (logical)
Have therefor made following in the init:
Code:
DoDefault()
THIS.Column17.DynamicCurrentControl = 'IIF(Artikele.Verkocht, "lblSold", "lblStock")'

And added the 2 labels with following code:

Code:
With This.Column17
	.RemoveObject('Text1')
	.Width = 14
	.Header1.Caption = 'Verkocht'
	.CurrentControl = 'lblSold'
	.CurrentControl = 'lblStock'
	.ControlSource = 'Artikele.verkocht'
	.Sparse = .F.
	.ReadOnly = .T.
Endwith
However VFP does not like this at all, since I am presented with following errorcode:
Error with Column17 - CurrentControl : Expression evaluated to an illegal value.

I am at a loss to correct this. Anybody around with a good advice?

Stay healthy,
Koen
 
These two lines are probably wrong:

Code:
.CurrentControl = 'lblSold'
.CurrentControl = 'lblStock'

You need to actually create the labels. It's not enough to point to them.

Something like this (in place of the above two lines):

Code:
.AddObject("lblSold", "label")
.AddObject("lblStock", "label")
.lblSold.Caption = "Verkocht"
.lblStock.Caption = "Voorraad"

Also, it doesn't make sense to set the ControlSource here, as labels cannot update the underlying table. If you need to do that, you might need to look for a different approach.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Also, there is a problem with this line:

Code:
THIS.Column17.DynamicCurrentControl = 'IIF(Artikele.Verkocht, "lblSold", "lblStock")'

You need to specify the full path to the two labels:

Code:
THIS.Column17.DynamicCurrentControl = ;
  'IIF(Artikele.Verkocht, "THISFORM.MyGrid.Column17.lblSold", "THISFORM.MyGrid.Column17.lblStock")'

I suspect this is what is causing the "illegal value" error that you saw.

(Obviously you need to change THISFORM.MyGrid to the correct reference for your grid.)

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Me said:
You need to specify the full path to the two labels:

Koen, I'm not sure that's correct. I've just been experimenting, and it looks like your original code might have been OK - provided you had already added the two labels to the column. Apologies if I have misled you.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Koen,

Please have a look at the code below. It's from a grid that uses checkboxes as controls. Maybe it gives you a hint

Code:
With .Column9
	.Width = 48
	.Header1.Caption = "Annulé"
	.NewObject("chkCancel","chkBox","vfp9lsp")
	.CurrentControl = "chkCancel"
	.chkCancel.Caption = ""
	.chkCancel.Visible = .T.
	.Sparse = .F.
EndWith

MarK
 
Hi Koen,

... and a demo for DynamicCurrentControl - the control is a green editbox when the last character is a digit; otherwise it's a red editbox.

Code:
PUBLIC go_Form

go_Form = CreateObject ("frmForm")
go_Form.Visible = .T.
go_Form.Show

READ Events
CLOSE ALL
CLEAR ALL


DEFINE CLASS frmForm As Form
	Width = 360
	MaxWidth = 360
	MinWidth = 360
	Height = 480
*!*		MaxHeight = 480
	MinHeight = 480
	AutoCenter = .T.
	Caption = "Grid with Editboxes"

	Add Object grdNames as Grid WITH ;
	    RecordSource = "curNames", ColumnCount = -1, Visible = .T., Top = 24, Left = 24, Height = 480 - (24 + 12 + 30 + 12), ;
    	RowHeight = 42, Width = 312, Anchor = 15

		PROCEDURE grdNames.Init()
		    WITH This.Column1
		    	.Header1.Caption = "Name"
		    	.NewObject("edtBox1","EditBox")
		    	.NewObject("edtBox2","EditBox")
				.edtBox1.BackColor = RGB(180, 180, 0)
				.edtBox1.Visible = .T.
				.edtBox2.BackColor = RGB(180, 0, 0)
				.edtBox2.Visible = .T.
				.DynamicCurrentControl = "IIF(ISDIGIT(RIGHT(ALLTRIM(cName), 1)), [edtBox1], [edtBox2])"
				.Sparse = .F.
			ENDWITH 

		    WITH This.Column2
		    	.Header1.Caption = "IsDigit?"
		    	.NewObject("chkBox1","CheckBox")
		    	.NewObject("chkBox2","CheckBox")
				.chkBox1.BackColor = RGB(180, 180, 0)
				.chkBox1.Caption = "Digit"
				.chkBox1.Visible = .T.
				.chkBox2.BackColor = RGB(180, 0, 0)
				.chkBox2.Caption = "Alpha"
				.chkBox2.Visible = .T.
				.DynamicCurrentControl = "IIF(ISDIGIT(RIGHT(ALLTRIM(cName), 1)), [chkBox1], [chkBox2])"
				.Sparse = .F.
			ENDWITH
 		ENDPROC 
	    
*!*		    PROCEDURE grdNames.Refresh()
*!*		    
*!*		    	IF MOD(RECNO(), 5) = 0
*!*		    		This.Visible = .F.
*!*		    	ELSE
*!*		    		This.Visible = .T.
*!*		    	ENDIF 
*!*		    ENDPROC 
*!*		    
*!*		    PROCEDURE grdNames.AfterRowColChange()
*!*				LPARAMETERS nColIndex
*!*		    	
*!*		    	This.Refresh()
*!*		    ENDPROC 


	ADD OBJECT cmdBack as CommandButton WITH ;
		Width = 60, Height = 30, Left = 24, Top = 480 - 42, Caption = "Back", Anchor = 6
		
		PROCEDURE cmdBack.Click()
		
			IF !BOF()
				SKIP - 1
				
			ELSE
			
				LOCATE 
			ENDIF 
			
			go_Form.grdNames.Refresh()
			
		ENDPROC 
		
	ADD OBJECT cmdNext as CommandButton WITH ;
		Width = 60, Height = 30, Left = 90, Top = 480 - 42, Caption = "Next", Anchor = 6
		
		PROCEDURE cmdNext.Click()
		
			IF !EOF()
				SKIP 1
				
			ELSE
				GOTO bottom
				
			ENDIF 
			
			go_Form.grdNames.Refresh()
			
		ENDPROC 
		
	ADD OBJECT cmdExit As CommandButton WITH ;
    	Width = 60, Height = 30, Left = 156, Top = 480 - 42, Caption = "Exit", Anchor = 6
    
		PROCEDURE cmdExit.Click()
			CLEAR Events
			ThisForm.Release
		ENDPROC
	  

		PROCEDURE Destroy()
			CLEAR Events
			ThisForm.Release
		ENDPROC
	    
		PROCEDURE Load
			Create Cursor curNames (cName Character(20), lIsDigit L)
				For li_I = 1 to 100
					INSERT INTO curNames (cName) VALUES ("X" + SYS(2015))
				Next li_I   
			
			REPLACE ALL lIsDigit WITH IIF(ISDIGIT(RIGHT(ALLTRIM(cName), 1)), .T., .F.)
			LOCATE  
			
		ENDPROC

ENDDEFINE


hth

MarK
 
Hi,

With following code the problem seems to be solved, thanks to Mike and Mark:

Code:
This.HeaderHeight = 26
With This.Column17
	.RemoveObject('Text1')
	.Width = 14
	.Header1.Caption = 'Verkocht'
	.Newobject('lblSold','SasClass.lblSold')
	.Newobject('lblStock','SasClass.lblStock')
	.lblSold.Visible = .T.
	.lblStock.Visible = .T.
	.ControlSource = 'Artikele.verkocht'
	.Sparse = .F.
	.ReadOnly = .T.
	.DynamicCurrentControl = 'IIF(Artikele.Verkocht, "lblSold", "lblStock")'
Endwith

Stay healthy,
Koen
 
Koen,

That looks exactly right. I have just written almost the same code myself in order to reproduce the problem.

For what it's worth, here is my code, but there is no reason for you to use it.

Code:
WITH this.Column17
  .AddObject("lblSold", "label")
  .AddObject("lblStock", "label")
  .lblSold.Caption = "Verkocht"
  .lblStock.Caption = "Voorraad" 
  .DynamicCurrentControl = "IIF(Artikele.Verkocht, 'lblSold', 'lblStock')"
  .Sparse = .F.
ENDWITH

Of course, you will use your own label classes.

One small point: there is no point in setting the ControlSource. Because you cannot edit a label, the control source will never update the underlying table. For the same reason, there is no point in making the colum read-only. But it does no harm.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike,
There is a 'funny' thing going on regarding the colors:
I have in myGrid.init (baseclass)
Code:
#Define ACTIVEROWFORCOL	"16711680"		&&&&kobalt blue
#Define ROWFORECOL			"0" 			&&black
#Define ACTIVEROWBACKCOL	[indent][/indent]"8454143"  	&&light  yellow
#Define ROWBACKCOL			"16777215"		&&white


*** Set up for highlight in current row
This.nRecNo = Recno( This.RecordSource )

This.SetAll( 'DynamicForeColor', ;
	'IIF( RECNO( This.RecordSource ) = This.nRecNo, ' + ACTIVEROWFORCOL +' , ' + ROWFORECOL + ')', 'COLUMN' )
This.SetAll( 'DynamicBackColor', ;
	'IIF( RECNO( This.RecordSource ) = This.nRecNo, ' + ACTIVEROWBACKCOL + ',' + ROWBACKCOL + ')', 'COLUMN' )

This will give a fine kobalt blue for the active row.

I have add labels lblSold and lblStock. LblStock is executed with Backcolor red and text 'Verkocht' , lblStock is executed with Backcolor white, no text and Backstyle=1
The result is that lblSold is shown with white backcolor, regardless if row is the activerow.

Even changed my init code as follows:
Code:
With This.Column17
	.RemoveObject('Text1')
	.Width = 14
	.Header1.Caption = 'Verkocht'
	.Newobject('lblSold','SasClass.lblSold')
	.Newobject('lblStock','SasClass.lblStock')
	With .lblSold
		.Visible = .T.
		.BackColor = Rgb(255,0,0)
		.BackStyle = 1
		.ForeColor = Rgb(0,0,0)
	Endwith
	.lblStock.Visible = .T.
	.ControlSource = 'Artikele.verkocht'
	.Sparse = .F.
	.ReadOnly = .T.
	.DynamicCurrentControl = 'IIF(Artikele.Verkocht, "lblSold", "lblStock")'
Endwith

And lblSold shows black letter on red background, I expected white on red. see picture for actual result
Stay healthy,
Koen
What am I doing wrong here?
Stay healthy,
Koen
 
Hi Koen,

This.SetAll("Dynamic...) overrides the settings of the controls of the grid. You may check by running the code below with This.Setall("Dynamic ...) commented/uncommented

Code:
PUBLIC go_Form

go_Form = CreateObject ("frmForm")
go_Form.Visible = .T.
go_Form.Show

READ Events
CLOSE ALL
CLEAR ALL


DEFINE CLASS frmForm As Form
	Width = 480
	MaxWidth = 480
	MinWidth = 480
	Height = 480
*!*		MaxHeight = 480
	MinHeight = 480
	AutoCenter = .T.
	Caption = "Grid with Editboxes"

	Add Object grdNames as Grid WITH ;
	    RecordSource = "curNames", ColumnCount = 3, Visible = .T., Top = 24, Left = 24, Height = 480 - (24 + 12 + 30 + 12), ;
    	RowHeight = 42, Width = 456, Anchor = 15

		PROCEDURE grdNames.Init()
			
 [highlight #F57900]                   This.SetAll("DynamicBackColor","IIF(MOD(RECNO(), 2) = 0, RGB(125, 125, 0), RGB(180, 180, 180))","Column")
[/highlight]
		    WITH This.Column1
		    	.Width = 180
		    	.Header1.Caption = "Name"
		    	.NewObject("edtBox1","EditBox")
		    	.NewObject("edtBox2","EditBox")
				WITH .edtBox1
					.ForeColor = RGB(0, 0, 0)
					.BackColor = RGB(210, 210, 0)
*!*						.Enabled = .F.
					.Visible = .T.
				ENDWITH 
				WITH .edtBox2
					.ForeColor = RGB(0, 0, 0)
					.BackColor = RGB(210, 0, 0)
*!*						.Enabled = .F.
					.Visible = .T.
				ENDWITH 
				.DynamicCurrentControl = "IIF(ISDIGIT(RIGHT(ALLTRIM(cName), 1)), [edtBox1], [edtBox2])"
				.Sparse = .F.
			ENDWITH 

		    WITH This.Column2
				.ReadOnly = .T.
		    	.Header1.Caption = "CheckBox"
		    	.NewObject("chkBox1","Checkbox")
		    	.NewObject("chkBox2","Checkbox")
				WITH .chkBox1
					.Caption = "Digit"
					.BackColor = RGB(210, 210, 0)
					.Visible = .T.
				ENDWITH 
				WITH .chkBox2
					.Caption = "Alpha"
					.BackColor = RGB(210, 0, 0)
					.Visible = .T.
				ENDWITH 
				.DynamicCurrentControl = "IIF(lIsDigit, [chkBox1], [chkBox2])"
				.Sparse = .F.
			ENDWITH

		    WITH This.Column3
		    	.Header1.Caption = "Label"
		    	.NewObject("lblDigit","Label")
		    	.NewObject("lblAlpha","Label")
				WITH .lblDigit
					.Caption = "Digit"
					.BackColor = RGB(210, 210, 0)
					.Visible = .T.
				ENDWITH 
				WITH .lblAlpha
					.Caption = "Alpha"
					.BackColor = RGB(210, 0, 0)
					.Visible = .T.
				ENDWITH 
				.DynamicCurrentControl = "IIF(lIsDigit, [lblDigit], [lblAlpha])"
				.Sparse = .F.
			ENDWITH
 		ENDPROC 
	    
*!*		    PROCEDURE grdNames.Refresh()
*!*		    
*!*		    	IF MOD(RECNO(), 5) = 0
*!*		    		This.Visible = .F.
*!*		    	ELSE
*!*		    		This.Visible = .T.
*!*		    	ENDIF 
*!*		    ENDPROC 
*!*		    
*!*		    PROCEDURE grdNames.AfterRowColChange()
*!*				LPARAMETERS nColIndex
*!*		    	
*!*		    	This.Refresh()
*!*		    ENDPROC 


	ADD OBJECT cmdBack as CommandButton WITH ;
		Width = 60, Height = 30, Left = 24, Top = 480 - 42, Caption = "Back", Anchor = 6
		
		PROCEDURE cmdBack.Click()
		
			IF !BOF()
				SKIP - 1
				
			ELSE
			
				LOCATE 
			ENDIF 
			
			go_Form.grdNames.Refresh()
			
		ENDPROC 
		
	ADD OBJECT cmdNext as CommandButton WITH ;
		Width = 60, Height = 30, Left = 90, Top = 480 - 42, Caption = "Next", Anchor = 6
		
		PROCEDURE cmdNext.Click()
		
			IF !EOF()
				SKIP 1
				
			ELSE
				GOTO bottom
				
			ENDIF 
			
			go_Form.grdNames.Refresh()
			
		ENDPROC 
		
	ADD OBJECT cmdExit As CommandButton WITH ;
    	Width = 60, Height = 30, Left = 156, Top = 480 - 42, Caption = "Exit", Anchor = 6
    
		PROCEDURE cmdExit.Click()
			CLEAR Events
			ThisForm.Release
		ENDPROC
	  

		PROCEDURE Destroy()
			CLEAR Events
			ThisForm.Release
		ENDPROC
	    
		PROCEDURE Load
			Create Cursor curNames (cName Character(20), lIsDigit L)
				For li_I = 1 to 100
					INSERT INTO curNames (cName) VALUES ("X" + SYS(2015))
				Next li_I   
			
			REPLACE ALL lIsDigit WITH IIF(ISDIGIT(RIGHT(ALLTRIM(cName), 1)), .T., .F.)
			LOCATE  
			
		ENDPROC

ENDDEFINE

hth

MarK
 
Koen, in addition to what Mark has said, I see you are using #DEFINEs to specify the colours. #DEFINEs work at compile time. I suspect that, at the point at which the DynamicForeColor and DynamicBackColor properties are evaluated, the #DEFINE values are not available. That would result in a syntax error in your IIFs. But VFP does not report that kind of syntax error; it simply fails to set the relevant property, which is what you are seeing.

You can confirm this by changing the #DEFINEs in your DynamicxxColor settings to hard-coded values.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Koen,

If you have more controlling conditions, you might want to consider ICASE(), e.g.

Code:
This.SetAll("DynamicBackColor","ICASE(MOD(RECNO(), 2) = 0, RGB(125, 0, 0), ;
				MOD(RECNO(), 3) = 0, RGB(125, 125, 0), ;
				MOD(RECNO(), 5) = 0, RGB(125, 125, 125), RGB(250, 250, 250))","Column")

hth

MarK
 
Hi,
The error in
Code:
With .lblSold
		.Visible = .T.
		.BackColor = Rgb(255,0,0)
		.BackStyle = 1
		.ForeColor = Rgb(0,0,0)
Endwith
corrected to RGB(255,255,255) white on red, does not make any difference.

To comment out the dynamiccolorsettings from This SetAll as abivised by Mark will show the labels in the colors as defined in the class.
So if you use SetAll.DynamicForeColor() and SetAll.DynamicBackColor() this will not only affect the rows but also the objects like a label in the row. It truly sets all the back- and forecolor.

Have changed my grid behavior accordingly.

Thanks Mark, Mike

Stay Healthy

Koen
 
Hi Koen,

So if you use DynamicForeColor and DynamicBackColor this will not only affect the rows but also the objects like a label in the row.

No, it's the SETALL() method that affects the settings on the class level

from the help file:

Use the SetAll method to set a property for all, or a certain class of, controls in a Container. For example, to set the BackColor property on all the Column objects in a Grid control to red, issue the following:

Form1.Grid1.SetAll("BackColor", RGB(255, 0, 0), "Column")

You can also set the properties for objects that are contained by other objects within the container. To set the ForeColor property of the Headers that are contained by each Column object contained in a Grid control to green, issue the following:

Form1.Grid1.SetAll("ForeColor", RGB(0, 255, 0), "Header")

In your grid you could for instance frmForm.grdGrid.SetAll("DynamicBackColor", condition, "lblStock") - this would only affect the settings of the lblStock class

hth

MarK

 
Mark,
Of course you are correct. I have corrected my wrongly constructed today's message from 07:24. Thanks for pointing out.
Stay healthy,
Koen
 
Hi,

What can you do on a rainy day? Well, just run the code below. It shows how SETALL() acts on different classes in a container (form) and the contained containers (grid and grid.column.header). Enjoy!

Code:
PUBLIC go_Form

go_Form = CreateObject ("frmColors")
go_Form.Visible = .T.
go_Form.Show

READ Events
CLOSE ALL
CLEAR ALL

RETURN

******

DEFINE CLASS edtColor as EditBox 
	Top = 12
	Height = 60
	Width = 60
	Anchor = 3
	BackColor = RGB(0, 252, 0)

ENDDEFINE

*****

DEFINE CLASS edtBlackWhite as EditBox
	Top = 84
	Height = 60
	Width = 60
	Anchor = 3
	BackColor = RGB(0, 0, 0)

ENDDEFINE

******

DEFINE CLASS frmColors AS form

    Height = 480
    Width = 360
    MinHeight = 480
    MinWidth = 360
    MaxWidth = 360
    DoCreate = .T.
    Autocenter = .T.
    Caption = "SetAll"
    Themes = .F.
    
    ADD OBJECT edtCh1 as edtColor WITH Left = 24
	    	
    ADD OBJECT edtCh2 as edtColor WITH Left = 96

    ADD OBJECT edtCh3 as edtColor WITH Left = 360 - 84 - 72

    ADD OBJECT edtCh4 as edtColor WITH Left = 360 - 84


    ADD OBJECT edtNCh1 as edtBlackWhite WITH Left = 24

    ADD OBJECT edtNCh2 as edtBlackWhite WITH Left = 96

    ADD OBJECT edtNCh3 as edtBlackWhite WITH Left = 360 - 84 - 72

    ADD OBJECT edtNCh4 as edtBlackWhite WITH Left = 360 - 84
    

	ADD OBJECT grdDBColor as Grid WITH ;
		Top = 162, ;
		Left = 24, ;
		Height = 168, ;
		Width = 360 - (2 * 24), ;
		RowHeight = 21, ;
		AllowRowSizing = .F., ;
		HeaderHeight = 21, ;
		AllowHeaderSizing = .F., ;
		DeleteMark = .F., ;
		Anchor = 75, ;
		Visible = .T.
		
		PROCEDURE grdDBColor.Init()
			WITH This
				.ColumnCount = -1
				.RecordSource = "csrTest"
				
				.Column1.Width = 300
				
				WITH .Column1.Header1
					.FontBold = .T.
					.FontItalic = .T.
		    		.Caption = "Item"
		    	ENDWITH 
		    ENDWITH 
		    
		ENDPROC 
	
    ADD OBJECT edtInfo as EditBox WITH ;
    	Left = 24, ;
    	Width = 360 - (2 * 24), ;
    	Top = 348, ;
    	Anchor = 30, ;
    	FontBold = .T., ;
    	Value = " - the BackColor of the edtColor class (first row) changes every 10s" + CHR(13) +  ;
    				"- the BackColor of the edtBlackWhite class (second row) toggles between B/W every 30s" + CHR(13) + ;
    				"- the BackColor of the grid rows toggles between Green/Blue every 30s" + CHR(13) + ;
    				"- the BackColor of the header also toggles between G/B"

	ADD OBJECT timChangeColor as Timer WITH ;
		Interval = 1000
		
		PROCEDURE timChangeColor.Timer()
			LOCAL liSeconds
			
			liSeconds = INT(VAL(SUBSTR(TIME(),7,2)) / 2)
		
			IF BETWEEN(liSeconds, 0, 15)
   	    		WITH ThisForm
   	    			.SetAll("BackColor", RGB(10, 10, 10),"edtBlackWhite")
   	    			.grdDBColor.SetAll("DynamicBackColor", "IIF(MOD(RECNO(),2) = 1, RGB(0, 200, 0), RGB(0, 150, 190))","Column")
   	    			.grdDBColor.SetAll("BackColor", RGB(0, 150, 190),"Header")
   	    		ENDWITH 
				
			ELSE 	
   	    		WITH ThisForm
   	    			.SetAll("BackColor", RGB(252, 252, 252),"edtBlackWhite")
   	    			.grdDBColor.SetAll("DynamicBackColor", "IIF(MOD(RECNO(),2) = 1, RGB(0, 150, 190), RGB(0, 200, 0))","Column")
   	    			.grdDBColor.SetAll("BackColor", RGB(0, 200, 0),"Header")
   	    		ENDWITH 

   	    	ENDIF
   	    	
   	    	ThisForm.grdDBColor.Refresh() 
		
    		DO case
    			CASE BETWEEN(liSeconds, 0, 5) OR BETWEEN(liSeconds, 16, 20)
	   	    		ThisForm.SetAll("BackColor", RGB(0, 160, 0),"edtColor")

    			CASE BETWEEN(liSeconds, 6, 10) OR BETWEEN(liSeconds, 21, 25)
	   	    		ThisForm.SetAll("BackColor", RGB(255, 120, 0),"edtColor")

    			CASE BETWEEN(liSeconds, 11, 15) OR BETWEEN(liSeconds, 26, 30)
	   	    		ThisForm.SetAll("BackColor", RGB(185, 0, 0),"edtColor")

	   	    	OTHERWISE 
	   	    		ThisForm.SetAll("BackColor", RGB(0, 0, 0),"edtColor")
	   	    
	   	    ENDCASE 
    	ENDPROC 
    	
	ADD OBJECT cmdExit As CommandButton WITH ;
    	Width = 48, Height = 30, Left = 360 - (48 + 24), Top = 480 - 42, Caption = "Exit", Anchor = 12
    	
		PROCEDURE cmdExit.Click()
			CLEAR Events
			ThisForm.Release

		ENDPROC

	PROCEDURE Destroy()
		CLEAR Events
		ThisForm.Release

	ENDPROC
	
	PROCEDURE Load()
		CREATE CURSOR csrTest (cItem c(20))

		FOR i = 1 TO 25
			INSERT INTO csrTest VALUES ("X" + SYS(2015))
		ENDFOR
		
		LOCATE  
		

ENDDEFINE

*****

MarK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top