Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Sandy Stephen
  Where is Sandy Stephen?
 Pune
 India
 Sandy Stephen
 To: tushar Kanvinde
  Where is tushar Kanvinde?
 Kolhapur, Maharastra
 India
 tushar Kanvinde
 Tags
Subject: RE: Caption of Command Button in Grid Row
Thread ID: 248872 Message ID: 248887 # Views: 8 # Ratings: 0
Version: Visual FoxPro 9 Category: Grids
Date: Thursday, December 24, 2009 12:05:44 PM         
   


> > Dear All
> >
> > I have a grid, in that command button is placed in a column of each row. The data is showing from a cursor.
> > I Want to show the grid serial as the caption of the command button.
> > How can I do that? Please help....
> >
> > Regards
> > Sandy
>
> Use a dynamic property like DynamicBackColor to change the caption.
>
>
> PUBLIC oform1
> 
> oform1=NEWOBJECT("form1")
> oform1.Show
> RETURN
> 
> 
> DEFINE CLASS form1 AS form
> 
> 
> 	DoCreate = .T.
> 	Caption = "Form1"
> 	Name = "Form1"
> 
> 
> 	ADD OBJECT grid1 AS grid WITH ;
> 		ColumnCount = 2, ;
> 		Height = 169, ;
> 		Left = 60, ;
> 		RecordSource = "temp", ;
> 		Top = 36, ;
> 		Width = 229, ;
> 		Name = "Grid1", ;
> 		Column1.ControlSource = "temp.x", ;
> 		Column1.DynamicBackColor = "thisform.setcaption()", ;
> 		Column1.Name = "Column1", ;
> 		Column2.CurrentControl = "Command1", ;
> 		Column2.Sparse = .F., ;
> 		Column2.Name = "Column2"
> 
> 
> 	ADD OBJECT form1.grid1.column1.header1 AS header WITH ;
> 		Caption = "Header1", ;
> 		Name = "Header1"
> 
> 
> 	ADD OBJECT form1.grid1.column1.text1 AS textbox WITH ;
> 		BorderStyle = 0, ;
> 		Margin = 0, ;
> 		ForeColor = RGB(0,0,0), ;
> 		BackColor = RGB(255,255,255), ;
> 		Name = "Text1"
> 
> 
> 	ADD OBJECT form1.grid1.column2.header1 AS header WITH ;
> 		Caption = "Header1", ;
> 		Name = "Header1"
> 
> 
> 	ADD OBJECT form1.grid1.column2.text1 AS textbox WITH ;
> 		BorderStyle = 0, ;
> 		Margin = 0, ;
> 		ForeColor = RGB(0,0,0), ;
> 		BackColor = RGB(255,255,255), ;
> 		Name = "Text1"
> 
> 
> 	ADD OBJECT form1.grid1.column2.command1 AS commandbutton WITH ;
> 		Top = 47, ;
> 		Left = 49, ;
> 		Height = 27, ;
> 		Width = 84, ;
> 		Caption = "Command1", ;
> 		Name = "Command1"
> 
> 
> 	PROCEDURE setcaption
> 		thisform.grid1.column2.command1.Caption=TRANSFORM(temp.x)
> 		RETURN thisform.grID1.column1.BackColor
> 	ENDPROC
> 
> 
> 	PROCEDURE Load
> 		CREATE CURSOR temp (x int)
> 		FOR lnCounter=1 TO 10
> 			INSERT INTO temp VALUES (lnCounter)
> 		ENDFOR
> 		GO top
> 	ENDPROC
> 
> 
> ENDDEFINE
> *
> *-- EndDefine: form1
> **************************************************
> 

>
> Regards
> Tushar



Thanks My Dear
Cheers
Sandy

ENTIRE THREAD

Caption of Command Button in Grid Row Posted by Sandy Stephen @ 12/24/2009 5:33:27 AM
RE: Caption of Command Button in Grid Row Posted by kulwant singh @ 12/24/2009 6:04:57 AM
RE: Caption of Command Button in Grid Row Posted by Sandy Stephen @ 12/24/2009 12:05:23 PM
RE: Caption of Command Button in Grid Row Posted by kulwant singh @ 12/24/2009 3:51:37 PM
RE: Caption of Command Button in Grid Row Posted by tushar @ 12/24/2009 6:04:45 AM
RE: Caption of Command Button in Grid Row Posted by Sandy Stephen @ 12/24/2009 12:05:44 PM