Two ListBox Handlers Short Circuit Each Other

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Spare Change (sparechange_at_spam.spam)
Date: 09/04/04


Date: Sat, 04 Sep 2004 21:41:55 GMT

Given for a ListBox

this.HLinks.MouseDown += new System.Windows.Forms.MouseEventHandler
(this.HLinks_MouseDown);//

this.HLinks.SelectedIndexChanged += new
System.EventHandler(this.HLinks_SelectedIndexChanged);

It seems I can have one but not the other.

If I use both, then the MouseDown event fires, when I change selection the
SelectedIndexChanged does not fire !

I use the MouseDown for a DragDrop event.

Sometimes I want to DragDrop from the ListBox to a TextBox; other times I
want to respond to a simple change in the selected Index of the TextBox via
a mouse click.

How ?

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.752 / Virus Database: 503 - Release Date: 9/3/2004


Relevant Pages

  • Re: Two ListBox Handlers Short Circuit Each Other
    ... > If I use both, then the MouseDown event fires, when I change selection the ... > Sometimes I want to DragDrop from the ListBox to a TextBox; ... > Outgoing mail is certified Virus Free. ...
    (microsoft.public.dotnet.general)
  • Two ListBox Handlers Short Circuit Each Other
    ... If I use both, then the MouseDown event fires, when I change selection the ... Sometimes I want to DragDrop from the ListBox to a TextBox; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Last Selection from MultiSelect Listbox
    ... What you can do is track the listbox selection in an array by modifying an array every time the listbox is changed. ... Dim idx As Integer, i As Integer ...
    (microsoft.public.excel.programming)
  • Re: Select range & copy
    ... I changed the range name of the ListBox stuff to mRefList ... "tvac" wrote: ... > Private Sub ListBox1_Click ... >> The first 2 columns have common data regardless of the selection. ...
    (microsoft.public.excel.programming)
  • Re: List of values
    ... I have to assume that the listbox is set to ... single-selection listbox. ... Private Sub ButtonOK_Click ... have shown is only the code to load the data into the listbox and display ...
    (microsoft.public.word.vba.general)