Accessing a Control on Another Dialog

Started by steezware, August 09, 2023, 06:19:35 PM

Previous topic - Next topic

steezware

So, I'm in a dialog and I want to access/update a control, say a listbox, on the window that spawned the current dialog with focus.

Seems like I used to know how to do this, but maybe it can't even be done?

Thx!

Ken Sproul

Are you doing a 'goto'(the_window_with_the_control), before trying to access the control?
Ken Sproul
DPI Information Service, Inc.
Pivotal Systems LLC

steezware

Figured it out:

PRINT 'SWAP'
LB'Visible = 0 (I passed the LB control value into the new 'process)
PRINT 'SWAP'

Thx for the 'goto' idea but tried 'swap' first and it worked.

Mike King

It likely would be easier to just use Pseudo control handles.  You can use the *system object to get the handle for any control in the system and then use it anywhere to access the control. 

https://manual.pvxplus.com/page/objctl2/overview.htm

->button 10,@(10,10,10,10)="hello
->osys=new("*system")
->%Btn_handle=osys'Control(10)
->?Btn_handle
1000100010
Mike King
President - BBSysco Consulting - http://www.bbsysco.com
eMail: mike.king@bbsysco.com