473,442 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How can I achieve this?

Hi, I've been trying to figure this out for a while now and I'm getting nowhere even though people tell me it's not only possible but easy.

I'm trying to self-learn VB so this is a basic issue.

Here is what I want to do, I want a textbox on form1 and a listbox on form2. I want typing in the textbox on form1 to populate the listbox on form 2.

But I also want a connection going the other way, when I click an item in the listbox on form 2, I want the text to appear in the textbox on form 1.

Could someone help me figure this out please?
Thanks
Dec 16 '19 #1
1 1553
SioSio
272 256MB
Since the condition that input to Textbox1 of Form1 is confirmed is necessary, press Button1 when the input is completed.
Declare Listbox1 of Form2 as Public.

Expand|Select|Wrap|Line Numbers
  1. Form1
  2. Private button1 As System.Windows.Forms.Button
  3. Private textBox1 As System.Windows.Forms.TextBox
  4. :
  5. :
  6. Sub Button1Click(sender As Object, e As EventArgs)
  7.     My.Forms.Form2.listBox1.Items.add(textBox1.text)
  8. End Sub
  9.  
  10.  
  11. Form2
  12. Public listBox1 As System.Windows.Forms.ListBox
Dec 17 '19 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Jim J | last post by:
I have been trying to find some kind of authentication method or script (PHP/perl/javascript or other) to achieve the following, with no luck. Say there are 100 files at a site. A person can...
1
by: Fuli Chang | last post by:
On a web page, when moving the cursor to an icon, button or a piece of text, a rectangle slot would automatically appear, in which some text is there explaining what the web page is about. For...
14
by: JKop | last post by:
class Cow { public: void EatGrass() const {} }; class Brow { private:
0
by: Gaurav Mantro | last post by:
Hi All, I want to make sure that a certain piece of code gets executed whenever *any* method is invoked for a given class. One way to do this is have that piece of code written as Macro or...
6
by: Chua Wen Ching | last post by:
Hi there, I have some questions to ask... just say i have this xml file: Scenario :- Script.xml ======== <software> <settings>
1
by: Chua Wen Ching | last post by:
Hi there, I try to find on the internet on how to achieve this, but still can't find any good resources till i downloaded Nant. But there are too many codes inside Nant, and i have no idea...
0
by: Wee Bubba | last post by:
i need to display some search results. ths client ID column of the search results rows will be a link and when a user clicks this link i need to: 1. get the values for 3 columns for that...
4
by: WStoreyII | last post by:
I am trying to mirror the drop down effect of the region in the vs.net ide like when you create a region and you can expand or collapse this region how is this done with code? WStoreyII
1
by: enquiry | last post by:
Couple of questions 1) I have been redesigning a website with css and I am creating a layout for a portfolio with using css. It is not incomplete with place holder images but can give an idea...
1
by: manionline | last post by:
The following is the query select a,b,count(1) count from tbl group by a,b order by a,b which will give the output like this a b count ============================== 18 A 16 18 B 6
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.