Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: Nadir Khan
  Where is Nadir Khan?
 Karachi
 Pakistan
 Nadir Khan
 Tags
Subject: RE: Add Command Button
Thread ID: 310673 Message ID: 310678 # Views: 34 # Ratings: 1
Version: Visual FoxPro 9 SP2 Category: Grids
Date: Thursday, June 23, 2011 11:52:58 AM         
   


> Dear Experts
>
> I have a grid in my form i want add a command button in column 3
> how to add Programmatically
>
> plesae help me with a example
>
> thanks
> Nadir

Hi Nadir,

* Assumed the name of your desired column is "column3", you can for instance do
* something like this in yourGrid.Init():
This.Column3.NewObject('myButton', 'myClass','myLibrary.VCX/PRG') && your class, or ...
This.Column3.AddObject('myButton', 'CommandButton') && ... the base class if you want

* Then set its visibility, and make it the "current control"
This.Column3.myButton.Visible = .T.
This.Column3.CurrentControl = 'myButton'

* And optionally turn .Sparse off if you want to see the button not only in the active row
This.Column3.Sparse = .F.




hth
-Stefan

ENTIRE THREAD

Add Command Button Posted by Nadir Khan @ 6/23/2011 11:40:08 AM
RE: Add Command Button Posted by Borislav Borissov @ 6/23/2011 11:48:47 AM
RE: Add Command Button Posted by Stefan Wuebbe @ 6/23/2011 11:52:58 AM