Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add a ctrl source to a commandbutton
Message
From
15/05/2012 04:29:22
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01543604
Message ID:
01543605
Views:
54
>Hi all,
>
>I want add data to a caption off a commandbutton IN A GRID.
>i want dus put a controlsource in this control.
>
>How can i do it ?
>
>ogrid.controls(1) = header
>ogrid.controls(2) = textbox
>ogrid.controls(3) = commandbutton
>
>
>Bindevents ?
>assign property to ctrl source of text2 object

Tricky, to say the least, because even if you set sparse=.t. for that column, it may set the caption to the same value for all rows. One trick I learned from Martina (or was it Martin Haluza?) is to introduce a dynamicfontbold_access method, which would fire before any refresh, and within that method to manipulate other properties of a column. In there, you could do .commandbutton.caption=[whatever you want].

Alternately, you could, in grid's .init(), do this

bindevent(this.column8.commandbutton, "refresh", this, "myRefresh")

and then in grid.myRefresh, use aEvents() to get a reference to the commandbutton, and then assign its caption to whatever you want.

I've tried both methods, although my goal was to accomplish something else, and I had limited success - it would work most of the time, except when it wouldn't :).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform