PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Accessing a Control on Another Dialog  (Read 1070 times)

steezware

  • Member
  • **
  • Posts: 16
    • View Profile
    • steezware
Accessing a Control on Another Dialog
« on: August 09, 2023, 06:19:35 PM »
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

  • Gold Member
  • ****
  • Posts: 60
    • View Profile
Re: Accessing a Control on Another Dialog
« Reply #1 on: August 09, 2023, 06:36:14 PM »
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

  • Member
  • **
  • Posts: 16
    • View Profile
    • steezware
Re: Accessing a Control on Another Dialog
« Reply #2 on: August 09, 2023, 07:14:02 PM »
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

  • Diamond Member
  • *****
  • Posts: 3818
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Accessing a Control on Another Dialog
« Reply #3 on: August 09, 2023, 09:03:36 PM »
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
eMail: mike.king@bbsysco.com

James Crowther

  • Member
  • **
  • Posts: 11
    • View Profile
Re: Accessing a Control on Another Dialog
« Reply #4 on: August 10, 2023, 01:13:49 PM »