2

I im doing a program to make a church management for my final year project of school, I have divide all the families that belong to the parish, and in each family there's several members (dad,mother,son,daughter,etc), I have the families divided my cods(famaly1,famaly2,famaly3) and also each family have a surname eg (Smith,Jones,Jackson)

now i know who ever uses the program will not know all the cods for all the family´s and i bet that the family's will not memorize there family cod so i want to make the search mode this way:

if the person search for the family cod then they will see enter image description here

if the person searchs for the family surname they will see

enter image description here

now what i want to know its how i can program the list box? because when i double click on the list box when coding i can only program what happens when the user clicks on the list box and i cant program what will happen when the user clicks on the surname

thnx for any help

om-nom-nom
  • 62,329
  • 13
  • 183
  • 228
P.Campos
  • 23
  • 5

1 Answers1

0

When you "double click" on the listbox using the visual editor, Visual Studio will generate the code-behind for the 'click' event for listbox.

Instead what you need to do is handle the ListControl's SelectedValueChangedEvent

That event is triggered when a user clicks on any ListControl Item.

The MSDN link I posted above has sample code to hookup to the event.

Alan
  • 45,915
  • 17
  • 113
  • 134
  • can you tell me how to use that cod because when i past it in vb nothing happens – P.Campos Mar 18 '12 at 23:26
  • You still need to hook up the method to the actual event. This question (first answer) shows how to do that in visual studio. http://stackoverflow.com/questions/1135299/microsoft-visual-studio-and-c-how-to-visually-add-events-to-controls – Alan Mar 18 '12 at 23:33
  • i still dint get it cant u pls make it and upload it and send me the download link – P.Campos Mar 18 '12 at 23:49