clicking a push button to open new window

Hello All,

I’m a beginner so go easy on me…

I have 2 push buttons and when clicked, I would like it to display another window that relates to said push button.

what would be the best code for this action?

All buttons and windows have already been created.

Thank you,
James Fletcher

To display say Window2, put in a PushButton:


Explanation here .


Much thanks. The link you provided is GOLD! I am not sure how I missed this.

Thank you again,
James Fletcher

The best habit to get into is to turn Implicit Instance off, so start now while you’re new.

Have you checked out the Introduction to Programming Textbook from Xojo?
It will teach you basics of programming but also gives a great overview of how to use Xojo itself.
When you’re done with that, there’s a full-on manual included in your installation of Xojo inside the Documentation folder.

With Implicit Instance off you manage Windows like you do any other class, but you must be more aware of the scope than when you have Implicit Instance on. So, assuming you picked a nice name for your second window like winSomethingBesidesTheDefault, you would create a new instance of it and then show it.

dim winInstanceOfThatSecondWindow as new winSomethingBesidesTheDefault winInstanceOfThatSecondWindow.Show()