[VB.net] appel de fonction avec un bouton

pavinho Messages postés 1 Date d'inscription   Statut Membre Dernière intervention   -  
voyageur59 Messages postés 1112 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,

j'aimerais savoir comment faire pour appeler une fonction avec un bouton dans un Windows Form.
ma fonction est :

Public Function ToSasProgram(ByVal data As String) As String
Dim sb As New StringBuilder()
sb.AppendFormat("title '{0}';", Title)
sb.AppendLine()
sb.AppendFormat("proc means data={0}", data)
sb.AppendLine("run;")
Return sb.ToString()
End Function

Merci

pavinho
A voir également:

1 réponse

voyageur59 Messages postés 1112 Date d'inscription   Statut Membre Dernière intervention   132
 
Bonjour,

Ton bouton appelle une sub.

Dans la sub de ton bouton tu mets l'appel de ta fonction:



Private Sub Bouton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bouton.Click

dim texte1 as string
dim data as string = "Données à passer à la fonction"

texte1=ToSasProgram(data)

end sub
2