Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...It's extraordinarily refreshing to see truly expert advice without having to wade through hipper than thou attitude..."

Geography

Where in the world do Tek-Tips members come from?

Get properties of a variable object at runtime

Jakyll (Programmer)
4 May 12 14:45
Hi,
New to Powerbuilder... I am trying to do something like this... I need to access a command buttons properties at runtime, but I won't know which one until it's clicked and a function is triggered (  myFunction(this.ClassName)  ) ...  I'm a C# programmer and don't know how to do this in PB

(in Pseudocode)
string myButton = "cb_1"
string result = ""

result = w_1.ControlsCollection(myButton).Text

I know there isn't such a thing as 'ControlsCollection' but I hope you understand my meaning... Any tips would be great!  Thank you in advance.
mbalent (Programmer)
5 May 12 16:56
Search PB help for the CREATE statement.

You could do something like this:

CODE

commandbutton lpo
string ls

ls = 'cb_1' // name of a commandbutton on the window

lpo = CREATE USING ls

messagebox('class',lpo.Text)

Matt

 

"Nature forges everything on the anvil of time"
www.anvil-of-time.com

Jakyll (Programmer)
14 May 12 15:30
Not exactly what I needed but helpful none the less thank you!

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close