Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I've got a listbox.

The listbox has a x count of items.

 

If i press the button on one of it there is some code executed.

But if number 2 is selected and i press the up or down keys. The other item is getting bleu.. but the code that should be executed doesnt.

 

If i do the code (fill_customer();) on the onload part, it is executed, but for the old one, so it runs 1 event after.

 

My code:

 


       private void lstKlant_KeyDown(object sender, KeyEventArgs e)
       {
           fill_customer();
       }
       private void lstKlant_KeyPress(object sender, KeyPressEventArgs e)
       {
           fill_customer();
       }

Posted
I'm slightly confused, it sounds like your trying to run code when a new item is selected, if this is the case you can use the OnSelectedIndexChanged method. If this isn't what your attempting todo, then I'm misunderstanding.
Anybody looking for a graduate programmer (Midlands, England)?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...