Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to pass the value to other form ( must use MDI )?
Message
From
18/01/2011 10:19:37
 
 
To
18/01/2011 09:48:14
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows XP
Miscellaneous
Thread ID:
01496399
Message ID:
01496413
Views:
33
>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()
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform