Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return Value from Modal Form
Message
 
À
11/05/2000 11:32:42
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00368596
Message ID:
00368708
Vues:
18
>Hi,
> How to pass/return value to/from modal form in VB?
>
>Thank you

There is one way.

On the first form, add a command button and paste this code:
Private Sub Command1_Click()
    MsgBox Form2.DisplayModal("This is a test")
End Sub
On the second form, add a text box and a command button and paste this code:
Private mstrValue As String

Private Sub Command1_Click()
    mstrValue = Text1.Text
    Unload Me
End Sub

Public Function DisplayModal(ByVal pstrParamIn As String) As String
    Text1.Text = pstrParamIn
    Me.Show vbModal
    DisplayModal = mstrValue
End Function
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform