Maybe a silly question.
I have an app which opens an Introduction window. Here there are 4 buttons each one leading to its specific window.
I could create a button in each window to get back to the Intro one but I thought of putting a menu command in the app menubar to perform this action.
My problem is: how do I detect which of the 4 windows is open so that I can close it and get back to the Intro? The MenuBar is the one of the app and not the one related to the open window
dim FoundWindow as Boolean
for currentWindow as Integer = 0 to App.WindowCount - 1
dim theWindow as Window = App.Window(currentWindow)
if theWindow.getWindowName = "PreferencesWindow" then
theWindow.Show
FoundWindow = true
end if
next
if not FoundWindow then
thePrefs.Show
end if
Public Function getWindowName(Extends theWindow as Window) As String
'returns the name of a Window
Dim theTypeInfo as Introspection.TypeInfo = Introspection.GetType(theWindow)
Return theTypeInfo.Name
exception exc
theException = new ErrorException(exc, currentMethodName)
End Function