473,563 Members | 2,667 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I achieve this?

1 New Member
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 1558
SioSio
272 Contributor
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
1522
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 choose which file to download from a list, and to do so has to enter a code or password. When a valid code or password is used they are redirected to a...
1
1544
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 instance, moving the cursor to the top of the IE browser and stop at an icon, a slot would appear. The text in it would be 'Back to . . .', 'Stop',...
14
1449
by: JKop | last post by:
class Cow { public: void EatGrass() const {} }; class Brow { private:
0
910
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 function and making call to that function in every method. But this is prone to errors in terms of a choice to do so and not a guranteed way that *special*...
6
1360
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
1198
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 which part of Nant code that can achieve this below. <?xml version="1.0"?> <project name="Property Test" default="test" basedir=".">
0
805
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 partivcular row ID (2 of the columns I dont want to display within my search results) and set some textbox.text values accordingly 2. toggle the...
4
1265
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
1033
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 www.i-catching.co.uk I am avoiding using the tables but I am not sure whether there is a better approach to achieve this layout by using css.
1
1331
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
0
7659
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8103
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7634
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7945
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6244
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5208
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3618
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2079
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.