Skip to main content

How do I pass values from textbox in one form to listbox of another form in vb.net?


Consider the TextBox1 is in Form1
ListBox1 in Form2.

If the event is Button click then the code will be

Form2.ListBox1.Items.add(TextBox1.text)


First you design GUI as




Then create second form as



Then code  as follows





If you want an Example Vb.net project of this problem  Click the below link

                                DOWNLOAD

            

Comments

Popular posts from this blog

How can we lose weight by eating fruits and cereals?

Now we can split fruits and cereals in two parts. First we are going to look how fruits help in weight loss.Here the list of 11 fruits that help to loss wight. Fruit is nature's ready-made snack packed with vitamins, fiber, and other nutrients that support a healthy diet. Fruit is also generally low in calories and high in fiber, which may help you lose weight. In fact, eating fruit is linked to a lower body weight and a lower risk of diabetes, high blood pressure, cancer, and heart disease. Here are 11 of the best fruits to eat for weight loss. 1. Grapefruit Grapefruit is a cross between a pomelo and an orange and is commonly associated with dieting and weight loss.    Half a grapefruit contains just 39 calories but provides 65% of the reference daily intake (RDI) for of vitamin C. Red varieties also provide 28% of the RDI for vitamin A ( 1 Trusted Source ).  What's more, grapefruit has a low glycemic index (GI), which means it r...

What are the properties of TextBox in Visual Basic?

         VB.Net - TextBox Control Text box controls allow entering text on a form at runtime. By default, it takes a single line of text, however, you can make it accept multiple texts and even add scroll bars to it. Let's create a text box by dragging a Text Box control from the Toolbox and dropping it on the form.     The Properties of the TextBox Control The following are some of the commonly used properties of the TextBox control − Sr.No. Property & Description 1 AcceptsReturn Gets or sets a value indicating whether pressing ENTER in a multiline TextBox control creates a new line of text in the control or activates the default button for the form. 2 AutoCompleteCustomSource Gets or sets a custom System.Collections.Specialized.StringCollection to use when the AutoCompleteSourceproperty is set to CustomSource. 3 AutoCompleteMode Gets or sets an option that controls how automatic compl...

Can I create tab control in vb.net without using toolbox control?

First we create a form in vb and we are going to add a tab by coding. Code is Here tab is created when form loads..... the output is as follows.. Now we can add some controls to each tab. in tab page1 a text box in tab page2 a combobox in tab page3 a listbox in tabpage4 a button. The code is The output is as follows