Code: Select all
[STAThread];
FUNCTION Start() AS INT
LOCAL oXApp AS XApp
TRY
oXApp := XApp{}
oXApp:Start()
CATCH oException AS Exception
ErrorDialog(oException)
END TRY
RETURN 0
CLASS XApp INHERIT App
METHOD Start()
LOCAL oMainWindow AS StandardShellWindow
oMainWindow := StandardShellWindow{SELF}
oMainWindow:Show(SHOWCENTERED)
SELF:Exec()
RETURN NIL
END CLASS
Code: Select all
USING System
USING System.Collections.Generic
USING System.Linq
USING System.Text
USING System.Windows.Forms
USING WindowsFormsApplication
[STAThread] ;
FUNCTION Start() AS VOID
Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault( FALSE )
Application.Run( Form1{} )
RETURN
The reason I ask is that when using a VO.App object created from a Windows.Forms form, contextmenus (ContextMenuStrip) on controls (for example a DataGridView) in a Windows.Forms form no longer automatically disappear when clicking outside of the menu, which is the usual behaviour. It is a very strange problem I have been trying to fix. The problem can be reproduced in a small sample Visual Studio solution, if anyone is interested.
Kees.

