Question about design

The project main window have a ListBox and some buttons.

When the user choose an entry in the ListBox, a second window appears and show data.
Is it possible to not swap from one window to the other (excepted if the user specifically want that by a click in the data window, of course) ?

I tried floating window (NO), global window (it stays above all windows, of course, so NO too).

Ideas ?

After the other window is opened, can you make a call like
App.MyWindow.Show ’ brings window to the front
to the window with the listbox?

Thanks Keith, I will try.

how about calling a update method in the second window with new data instead of open close it always.
call a method in second window would not move the ui focus.

Hi Markus,

I do not understand your “calling a update method in the second window”…

Actually, in the second window, the code is located in the Activated Event.

I add Self.Show in the end of the SelectionChange Event (after second window .Show).

Apparently (on my laptop) this works fine.

But now I have another problem (read the next thread).

that is a bad place, just move the content into other public method
pseudocode:

var w2 as new Window2
w2.hereismydata(data) or w2.hereismydata(id)
w2.show

if you store the second window in a property W2 once

W2 = new Window2
W2.hereismydata(data) or W2.hereismydata(nil)
W2.show

if you reuse the window its just a call
W2.hereismydata(data)

The code there takes a FolderItem stored in RowTag (main window → module before showing the second window) and load the whole set of data / display them in the (second) window.
Works like a charm.

Why ?

Why ?

Actually, Window2.Show is enough (I only added Self.Show after that line).

Care to explain ?

PS: I can also enlarge the main window (wMain), set the LixtBox location to the left (as a left bar), place the interface from Window2 (wData) and simply display the data directly in ListBox1.SelectionChange

if the code is written in a event you can not reuse it and only called exactly when you open a window and it gets the focus.

at the time of VB6 i had trouble with functionality in form events for example at debugging/break points.

Window2

with multiple window instances the user can compare data, or copy data from one to other input mask.
and with a new instance there is not old data from look before.

This event is fired each time the window appears frontmost: Activated.

Actually, when I modify the data in another application and save it, when I click in the window data, the new contents is displayed.

When I change the selection in wMain, the wData window is fired and a new contents is displayed accordingly to the new selection.

I worked nearly with this (running) project this whole afternoon until now (around 10 hours) and I do not see any trouble at all (I do not even get errors elsewhere).