Load Subroutine on window open.

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Blair.

I would like to load a procedure to load a database in the window open event. How can I do this? I know how to get the database opened and how to get data from it. But how do I get the procedure to run when the form is opened?
Code example would be helpful.

Thanks in advance.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by El_Choni.

If I understand your answer, you want to call a procedure when a window is opened. You don't need to catch the window open event (which is not reported, unless you use the Windows API to register the window class, create the window and process #WM_CREATE): after you open a window, just call the procedure:

Code: Select all

If OpenWindow(....)
  LoadDatabase(...) ; your procedure
El_Choni
Post Reply