Change window type programatically

is it possible to change the window type before it opens from a sheet window to a floating window ,
depending on a variable ?

no

thanks Norman

When I’ve needed to do that I put the contents in a container controls then I can embed the container in a sheet or floating window as needed

norman… that is exactly what i did too…

or you make 2 similar windows in the ide, then call one or the other at runtime.

easier to use same container control with 2 different window type

can anyone explain how to use a container control as sheet or as floating window ?

You do not use it as a window. You place controls over it, then drag an instance over or add it dynamically to the sheet or floating window.

That said, my personal preference is to design the window as usual, then duplicate it, make one floating, the other sheet, and display which ever one I need.

i called this method from the open event of the 2 different windows


SUB DoScreenOpenEvent
  SELECT CASE gImageType
  CASE "ImageList"
    DIM ccImageList1 AS ccImageList
    ccImageList1 = new ccImageList
    ccImageList1.EmbedWithin (vForm, 0, 0 )
  CASE "Thumbnail"
    DIM ccThumbnail1 AS ccThumbnail
    ccThumbnail1 = new ccThumbnail
    ccThumbnail1.EmbedWithin (vForm, 0, 0 )
  CASE "Images"
    DIM ccImages1 AS ccImages
    ccImages1 = new ccImages
    ccImages1.EmbedWithin (vForm, 0, 0 )
  END SELECT
END SUB

Michael you are probably right by having two windows and use one or the other depending on a variable.
thanks to all

[quote=139281:@Johann JFK]Michael you are probably right by having two windows and use one or the other depending on a variable.
thanks to all[/quote]
If you need to change the window in the future you’ll have to do it twice, and you better be very specific about your changes or users will notice the difference. Also, if you put code on an object on the window/sheet, you’ll need to duplicate the method as well - which will cause all kinds of headaches in the future trying to maintain two of the same method.

It’s much easier in the long run to create a container control and embed where you need it.

[quote=139316:@Tim Parnell]If you need to change the window in the future you’ll have to do it twice, and you better be very specific about your changes or users will notice the difference. Also, if you put code on an object on the window/sheet, you’ll need to duplicate the method as well - which will cause all kinds of headaches in the future trying to maintain two of the same method.

It’s much easier in the long run to create a container control and embed where you need it.[/quote]

You can also do the change and duplicate the window.

True, the Container Control placed on the window alleviates that need, but the OP seems quite lost with that.