====== A VO GUI application with a Windows Forms window ======
Thanks to the work of Paul Piko there is the possibility to add a WinForms to a VO GUI application.
These are the steps:
* Instead of using the "normal" App class from the VO GUI classes use the VOWinFormApp class (contained in the X# VO GUI classes window)
[STAThreadAttribute];
function Start( asCmdLine as string[] ) as int
local oMainWindow as StandardShellWindow
local oApp as VOWinFormApp // App
oApp := VOWinFormApp{} // App{}
oMainWindow := StandardShellWindow{oApp}
oMainWindow:Show(SHOWCENTERED)
oApp:Exec()
return 0
* when opening your Windows Forms window, use a ChildWinForm object as owner:
local oForm as MyWinForm
local oChild as ChildWinForm
oChild := ChildWinForm{ self, true }
oChild:Menu := StandardShellMenu{ oChild }
oForm := MyWinForm{ oChild }
oChild:WinForm := oForm
oChild:Show()
* when you need to close your Windows form, call the :EndWindow() method of your ChildWinForm owner object:
method CloseButtonClick(sender as System.Object , e as System.EventArgs) as void
_oOwner:EndWindow()
return
You can find a sample of such an application here (in form of a XIDE export file):
[[https://www.riedmann.it/download/VOGuiWinforms.zip|www.riedmann.it/download/VOGuiWinforms.zip]]