MenuBar and Window

Hi everyone, my name is Luka and I am a new user on Xojo. I discovered this software a few days to create executables for windows and I’m really surprised, a great program and I also bought the license. I have a question for you. I created a software to manage some documents and various stuff, this only with a window. Now I have seen that I can also interact with the menu bar and my question is this. Is it possible to add an entry to the menubar that if you click on it opens a second window? If yes how? Thank you and greetings

Hi Luka,

Absolutely, you can do that! Probably you’ll find of interest the “Getting Started” course available at: http://documentation.xojo.com/topics/user_interface/desktop/everything_about_desktop_menus.html

Javier

Hi @Javier Menéndez I read this document. One question: for to go another window to menubar, how can i make this? I don’t read

Great videos, I think, but they are in Spanish. Is there an English version? Also, on that webpage I don’t find an explanation how to open another window using the menu items.

put this code in a menu handler that has the name of the menuitem you want.

dim w as new Window2 if w<>nil then w.show end if

@Jean-Yves Pochez — That works well for simple windows but for complex ones, you may rather use

w.visible = true

so that you do not force the window to be displayed before it has finished initializing.

I follow the code of @Jean-Yves Pochez and it works. The Last question, I have a screen for the serial terminal. Now, for to clear the TextArea, how can i make this?

How about <name of TextArea> = ""?

What about reading the TextArea entry in the LR ?
LR is my saver (usually, for things like that).
Once there, read .Text.

This works for me in a menu handler:

LocationsWindow.visible = true
Return True

And when opening the same window from a button on the Toolbar, this works as well:

Select case item.name
Case “LocationsTBI”
LocationsWindow.visible = true
End select

I recommend using containers to navigate

I am using containers on page-panels and navigate using the page panels. The project I am working on right now has 8 different page-panels to switch between. This works great in combination with the buttons on the toolbar.