473,394 Members | 1,971 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Show information from the selected item in a ListBox to an other form

Hallo,

I have 2 forms. In one form (let's call it frmClient) I have
textboxes, comboboxes, etc in which I can save/update information to a
database (MySQL to be more exactly).

The other form (frmClientBrowser) shows the information saved in the
database in a ListBox. In this form I have three buttons, one button
(btnAdd) display the frmClient form with no values in the controls (I
just call the form), the second button (btnEdit) should display the
information to edit from the selected item in the ListBox.

The question is: How do I fill the information to the controls in the
frmClient form from the selected item in the ListBox from the
frmClientBrowse form so I can only edit the information I want?

I'm using VB.NET

Thanks in advance.

PS My apologies for my bad english.

Best Regards,
David Desmet
Jun 27 '08 #1
2 1173
On Jun 11, 5:11 am, iDesmet <idesmet.w...@gmail.comwrote:
Hallo,

I have 2 forms. In one form (let's call it frmClient) I have
textboxes, comboboxes, etc in which I can save/update information to a
database (MySQL to be more exactly).

The other form (frmClientBrowser) shows the information saved in the
database in a ListBox. In this form I have three buttons, one button
(btnAdd) display the frmClient form with no values in the controls (I
just call the form), the second button (btnEdit) should display the
information to edit from the selected item in the ListBox.

The question is: How do I fill the information to the controls in the
frmClient form from the selected item in the ListBox from the
frmClientBrowse form so I can only edit the information I want?

I'm using VB.NET

Thanks in advance.

PS My apologies for my bad english.

Best Regards,
David Desmet
Generally, when communicating across forms my preferred method is to
have the first form fire an event that the second form can listen to.
In your case I would recommend creating a custom EventArgs class that
will hold the data the second form needs and create a custom event to
use that EventArgs class.

If you need help on wiring up the events, a quick search on Google
should provide several good links. If you have any further questions
you can't find on Google, please ask again here and I (or others) will
try to help out.

Thanks,

Seth Rowe [MVP]
Jun 27 '08 #2
On Jun 11, 7:03*am, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Jun 11, 5:11 am, iDesmet <idesmet.w...@gmail.comwrote:
Hallo,
I have 2 forms. In one form (let's call it frmClient) I have
textboxes, comboboxes, etc in which I can save/update information to a
database (MySQL to be more exactly).
The other form (frmClientBrowser) shows the information saved in the
database in a ListBox. In this form I have three buttons, one button
(btnAdd) display the frmClient form with no values in the controls (I
just call the form), the second button (btnEdit) should display the
information to edit from the selected item in the ListBox.
The question is: How do I fill the information to the controls in the
frmClient form from the selected item in the ListBox from the
frmClientBrowse form so I can only edit the information I want?
I'm using VB.NET
Thanks in advance.
PS My apologies for my bad english.
Best Regards,
David Desmet

Generally, when communicating across forms my preferred method is to
have the first form fire an event that the second form can listen to.
In your case I would recommend creating a custom EventArgs class that
will hold the data the second form needs and create a custom event to
use that EventArgs class.

If you need help on wiring up the events, a quick search on Google
should provide several good links. If you have any further questions
you can't find on Google, please ask again here and I (or others) will
try to help out.

Thanks,

Seth Rowe [MVP]
Seth,

Thank you very much for your quick reply! I'll try that. I'm searching
on Google right now...

In case I can't achieve what I want to do, I'll ask again here.

Thanks again!

Best Regards,
David Desmet
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Peter Moscatt | last post by:
I am having trouble understanding the methods for the Listbox from Tk. If I was to select at item in the list using a mouse click (have already created the bind event) - what method returns the...
3
by: RC | last post by:
I have a form where the user enters the Model info. The user picks the Model from either a combobox or listbox which both are filled from the Models table. If the Model type isn't in the boxes,...
2
by: Alpha | last post by:
How do I change the selected item in a listbox according to a Combox's selected item on the same form? The Combox is from a different table in the same dataset as the Listbox uses. Combox's...
6
by: David De Cotis | last post by:
Hello all, I am trying to go through a ListBox and verify if am item was selected. If an item was selected, I would like to get a handle of the item and simply do a response.write on the selected...
1
by: Karen Grube | last post by:
Hi! I'm using a standard server side ASP.Net listbox control on a web form. The page is basically various shades of green. The listbox itself has a pale green background and forest green text...
7
by: Brian Henry | last post by:
I have a list box bound to a data set, of course the datasource,datamember, and valuemember are set, i tell it selecteditem = -1 to make nothing selected, select mode is set to only one item at a...
8
by: PAPutzback | last post by:
How do I keep the form up.
1
by: acord | last post by:
Hi, I am having problem to get a value of the selected item from a dropdown listbox. Here is the JS function; function getSelectedItem(objSelect) { alert("in getSelectedItem"); alert...
3
by: Mitch | last post by:
Is the following a correct representation of the relationship of the selected index to selected item: INDEX ITEM 0 "item 1" 1 "item 2" 2 "item 3" and so on. I keep...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.