|
There are several ways of creating custom forms in Manifold: 1. You can use form components. This way, you create a form component and insert the desired event handlers such as Button_Click into the attached script component. This is only available for non-.NET scripts, that is, VBScript and JScript. 2. You can use COM objects. This way, you create a COM object using the language and technology of your choice (VC++ / ATL, VC++ / MFC, VC++ / raw Win32 API, VB 6, VB .NET / WindowsForms, C# / WindowsForms, anything else), and call that COM object from within a script. This is available for both non-.NET and .NET scripts. 3. You can use various system and third-party libraries to build a form on the fly using code. For example, you can use WindowsForms to build forms in .NET scripts. Example: 'VB .NET Imports Manifold.Interop.Scripts Imports System Imports System.Drawing Imports System.Windows.Forms Class Script Shared Sub Main Dim f As New MyForm f.ShowDialog End Sub Class MyForm Inherits Form Public Sub New Dim b As New Button b.Location = New Point(20, 20) b.Text = "Say Hello" AddHandler b.Click, AddressOf B_Click Controls.Add(b) Text = "My Form" End Sub Private Sub B_Click(ByVal _sender As Object, ByVal _args As EventArgs) MessageBox.Show("Hi") End Sub End Class End Class
|