Need help with multiple forms

fantity

Active member
Joined
Mar 10, 2012
Messages
27
Programming Experience
Beginner
I want to add a favorites tab to my web browser. I made it into a different form within my project. But I get an error saying it can't find TabControl1 which is on Form1. How do I allow Form3 to get information from Form1? This is my code:

VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        My.Settings.Bookmarks.Add(CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).URL.ToString)
        ListBox1.Items.Clear()
 
Hello

If I am reading this right you want to access an object on one form from another. To do this, say you have formone and formtwo and on formtwo you have a listbox called listbox1. To accessthe listbox object by putting for instance formtwo.listbox1.clear.

So basicaly you refer to the form aswell as the object on it to access that object.

regards
 
Back
Top