Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to pass the value to other form ( must use MDI )?
Message
De
18/01/2011 10:19:37
 
 
À
18/01/2011 09:48:14
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows XP
Divers
Thread ID:
01496399
Message ID:
01496413
Vues:
34
>sorry, i say not clear.....
>My question is one form pass one form .....
>See my code, 3 form .....
>i want to storageAdvice form onclick button ,will show the B form ,
>B form is a finder will pass a code to storageAdvice.TextBox1.Text
>
>
>In A.vb
>---------------
>storageAdvice = New Quotation_Add
>storageAdvice.MdiParent = Me
>storageAdvice.Show()
>
>
>In storageAdvice.vb
>-------------
>
>
> B.Show()
>
>
>
>In B.vb
>---------------
>
>storageAdvice.TextBox1.Text = "aaa"
>
>
>
>But after the result storageAdvice.TextBox1.Text  is blank
>
>
If you want to access a Textbox in the 'parent' form from form B pass a reference to it in the constructor. Form B:
Public Class B
    Public caller As Quotation_Add

    Public Sub New(ByVal caller As Quotation_Add)
        InitializeComponent()
        Me.caller = caller
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        caller.TextBox1.Text = "aaa"
    End Sub
End Class
Create with
 Dim aB As New B(Me)
aB.Show()
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform