Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear All,

I am trying to create the Form1 with SplitContainer1 inside the form. The Splitcontainer has 2 panel. Left and Right panel. I load Form2 in left panel and Form3 in right panel.

In Form2 ( left panel ) I put TextBox1. Then I wont to change the TextBox1.Text from the right panel using the event in right form.

My problem is : How to reference to object in Form2 to from form3.
I am new in VB Net, I just now Ms. Access that I always use the "Expression Builder" to refer to object.
I try this but it does'nt work :

Form2.TextBox1.Text = "Test reference "


Please help the code or a reference that I could learn regarding the subject.
Thank you,

Regards,
Wayan S
Posted
Updated 24-Aug-13 17:55pm
v2
Comments
Sergey Alexandrovich Kryukov 25-Aug-13 15:10pm    
How a form could be in a panel?
(However, what do you mean by a "Form": System.Windows.Forms.Forms or Web form? You should always tag the UI library of application type you are using, when UI is involved.)
—SA
Member 3920873 26-Aug-13 7:36am    
@SA :
Thank you for your comment, my application is Windows Form,
Here is the code to load the form into SplitContainer Panel :

Public Class Form1
Public frmLeft As New Form2
Public Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

Dim frmRight As New Form3

frmLeft.TopLevel = False
frmRight.TopLevel = False
frmLeft.Parent = SplitContainer1.Panel1
frmRight.Parent = SplitContainer1.Panel2
frmLeft.Show()
frmRight.Show()

End Sub

End Class
F. Xaver 26-Aug-13 7:51am    
Why are you using Forms inside the Splitcontainer?
If you don't realy need this to be Forms, you could just use the normal Events of the Textbox within Form1.

If you need this to change the SplitContainers content, I would suggest using an UserControl, where you add those Events you need.
Member 3920873 26-Aug-13 10:07am    
Helo F.X, My App is about GantChart combine with Line curve, they are plotted on a single windows form. Then I need to "freeze" the form so the user could see the left Task while scrolling the GantChart at right side to the part they want to see, the same behave as the "freeze" function in ms.Excel sheet. I look for that in VB Net and try to use SplitContainer. Is there another simpler way to produce the "freeze" like in Excel Sheet ?
Thank you.
F. Xaver 27-Aug-13 3:20am    
as I understand you, all you need is to set te SpliterPanel.AutoScroll to True
so you can scroll the left and the right side seperated, while the other one 'freezes' is this what you mean?
(Docking a Panel in the SplitterPanels gives you eaven more options)


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900