Gemeinsam zu mehr Effizienz in der Anwendungserstellung
|  (→VB.NET UserControl) |  (→VB.NET UserControl) | ||
| Zeile 88: | Zeile 88: | ||
| * Installieren Sie den DotNetControlContainer im System   | * Installieren Sie den DotNetControlContainer im System   | ||
| * Erstellen Sie eine leere Access Testdatenbank (mdb oder accdb)   | * Erstellen Sie eine leere Access Testdatenbank (mdb oder accdb)   | ||
| - | * Importieren Sie die Klasse NetComDomain aus der Access CodeLib   | + | * Importieren Sie die Klasse [http://source.access-codelib.net/filedetails.php?repname=CodeLib+%28Entwurf%2C+branches%2Fdraft%29&path=%2Fcom%2FNetComDomain.cls NetComDomain] aus der Access CodeLib   | 
| ** Wenn Sie für den Import nicht den Import Assistenten der Access CodeLib verwenden, müssen Sie händisch einen Verweis auf C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.tlb sowie einen Verweis auf C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscoree.tlb hinzufügen.   | ** Wenn Sie für den Import nicht den Import Assistenten der Access CodeLib verwenden, müssen Sie händisch einen Verweis auf C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.tlb sowie einen Verweis auf C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscoree.tlb hinzufügen.   | ||
| * Erstellen Sie ein neues, leeres Formular und öffnen Sie es im Entwurfsmodus   | * Erstellen Sie ein neues, leeres Formular und öffnen Sie es im Entwurfsmodus   | ||
| Inhaltsverzeichnis | 
Option Compare Database Option Explicit Private Sub Befehl1_Click() Dim DllPath As String DllPath = "C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll" Dim WinForm As Object With New NetComDomain Set WinForm = .CreateObject("Form", "System.Windows.Forms", DllPath) WinForm.TopLevel = False End With Me.ControlContainer0.Object.LoadControl WinForm Set WinForm = Nothing With Me.ControlContainer0.Object.Control .Text = "Das ist ein .NET Winform" .StartPosition = 1 .ShowIcon = False .Show End With End Sub
Public Class UserControl1 Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click MsgBox("Hello World") End Sub Public Function SayHello() As String Return "Hallo, ich bin eine Public Function!" End Function End Class
Option Compare Database Option Explicit Private Sub Befehl1_Click() Dim DllPath As String DllPath = Application.CodeProject.Path & "\" & "ClassLibrary1.dll" With New NetComDomain Me.ControlContainer0.Object.LoadControl .CreateObject("UserControl1", "ClassLibrary1", DllPath) End With MsgBox Me.ControlContainer0.Object.Control.SayHello End Sub