7 Years
Discussion Span
Last Post by jonc

I understand what SHOW does. I want the terminology of what it is. In Visual FoxPro, both SHOW and LOAD were considered event methods and they both gave the programmer the ability to add custom code. VB only allows me to add custom code to LOAD. So ... I am wondering what is SHOW if it is not an Event Method.


Object Browser within VB6 says:

Sub Show([Modal], [OwnerForm])
Member of VB.Form
Displays an MDIForm or Form object.

Event Load()
Member of VB.Form
Occurs when a form is loaded.

Say (for example's sake) I have a form called frmMainWindow.
I want to open the form as it is and display it onscreen, so I would do


I can make it modal (i.e. it becomes the foremost window of the VB application I created by doing

frmMainWindow.Show vbModal


Now, if I had the same form (frmMainWindow), but wanted to pass some information into the form which I intend on using when displaying the form onscreen (and the data controls on it for example), I would first load the form

Load frmMainWindow

and then I would have exposed the public properties/subs/functions within the form so I can use them where I am.

Load frmMainWindow
frmMainWindow.ExampleProperty = "blah"
bTest = frmMainWindow.ExampleFunction("info",1)
frmMainWindow.Show vbModal

There, I have loaded the form into memory, then used an example property, sub and function before displaying the form using .Show

I hope that has helped? If I have just pretty much repeated what you already knew, then I apologise :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.