[VB 2008]Création et utilisation de fonction dans une DLL
Bonjour,
voila j'apprends à crée des petit programme en VB, et j'en suis arrive à crée un application .exe avec une .dll
Voila ce que j'ai
Pour la .dll
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.IO
Imports System.Runtime.InteropServices
Imports System.Threading
Imports System.Xml
Imports MySql.Data.MySqlClient
Public Class Class1
Public Function Copie(ByVal Texte As String)
Dim a
a = Nothing
a = " >>> " & Texte & " <<< "
Form1.Label1.text = a
Return 0
End Function
End Class |
Pour le .exe, il y a juste une zone de texte, un label et un bouton
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.IO
Imports System.Runtime.InteropServices
Imports System.Threading
Imports System.Windows.Forms
Imports System.Windows.Forms.TextBox
Imports System.Windows.Forms.Label
Imports System.Xml
Imports MySql.Data.MySqlClient
Imports ClassDefault
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Variable As ClassDefault.Class1
Variable = New ClassDefault.Class1
Variable.Copie(TextBox1.Text)
End Sub
End Class |
Mon problème vient de Form1.Label1.text = a qui est Friend. C'est la que je ne comprend rien.
Donc s'il vous plait est ce que quelqu'un pourrais m'expliquer, merci