DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Click Event of Listbox

  1. #1
    Join Date
    Jul 2004
    Posts
    366

    Question Click Event of Listbox

    Hello All,

    I have some code in the click event of my listbox. Whenever I use this listbox with other code it runs through this click event. How do I stop this? I'm passing the listbox to a function, it runs the click event first then my function. I don't want it to run the click event code unless I click on the listbox. No other time!

    Thanks.

    jb

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Can you provide more information? You must be doing something in your code that's triggering the Click event.

    I just added a ListBox to a form and put a MsgBox statement in the Click event handler. Then in the Form_Load handler, I set the ListBox's SelectedIndex property. When I run the project, I get no MsgBox, so the Click event is not firing.
    Last edited by Phil Weber; 10-25-2006 at 11:49 AM.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Jul 2004
    Posts
    366
    All I'm doing is this:

    cClass.FillListBox(lbUsers)

    Fill control just addes records to the listbox. Before it does anything in the FillControl method, it goes to the click event of the listbox and runs what's there.

    Jim

  4. #4
    Join Date
    Jul 2004
    Posts
    366

    Question

    Another thing, since I'm passing it this way. When I select an item from the listbox it has no value. I'm doing this: dim SelectUser as string = lbUsers.SelectedItem, this doesn't work now. What gives....???

    jb

Similar Threads

  1. Adding a Click Event to a Label
    By Hunterlmc in forum .NET
    Replies: 3
    Last Post: 04-07-2005, 10:53 PM
  2. Re: App Object (fixes)
    By Rob Teixeira in forum .NET
    Replies: 129
    Last Post: 06-06-2002, 05:23 AM
  3. Windows Forms with listbox (Click Event)
    By Steve Hall in forum .NET
    Replies: 0
    Last Post: 04-03-2002, 05:44 AM
  4. No listbox click event
    By Jeff Pipes in forum .NET
    Replies: 2
    Last Post: 03-18-2002, 08:03 PM
  5. Re: List Boxes? and the Click event
    By Ray Wimsett in forum VB Classic
    Replies: 0
    Last Post: 07-20-2000, 04:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center