Click here to Skip to main content
15,899,475 members
Home / Discussions / C#
   

C#

 
AnswerRe: Using shell? [modified] Pin
Krecik_PL1-Oct-07 7:51
Krecik_PL1-Oct-07 7:51 
GeneralRe: Using shell? Pin
Dave Kreskowiak1-Oct-07 9:18
mveDave Kreskowiak1-Oct-07 9:18 
GeneralRe: Using shell? Pin
Krecik_PL1-Oct-07 9:49
Krecik_PL1-Oct-07 9:49 
QuestionActive folder that calls my dll or com Pin
nishchalp1-Oct-07 5:01
nishchalp1-Oct-07 5:01 
AnswerRe: Active folder that calls my dll or com Pin
Dave Kreskowiak1-Oct-07 5:06
mveDave Kreskowiak1-Oct-07 5:06 
GeneralRe: Active folder that calls my dll or com Pin
nishchalp1-Oct-07 5:11
nishchalp1-Oct-07 5:11 
AnswerRe: Active folder that calls my dll or com Pin
TJoe1-Oct-07 5:14
TJoe1-Oct-07 5:14 
Questionsharing an event handler, not getting what I expect Pin
JoeRip1-Oct-07 3:47
JoeRip1-Oct-07 3:47 
In my code I create three combo boxes, and store them in an ArrayList. So:

myArrayList.Insert(0, new System.Windows.Forms.ComboBox());<br />
myArrayList.Insert(1, new System.Windows.Forms.ComboBox());<br />
myArrayList.Insert(2, new System.Windows.Forms.ComboBox());


I then add each of these comboboxes to my form; at the same time, I bind each of them to a shared data source and a shared event handler:

<br />
myForm.Controls.Add((ComboBox)myArrayList[0]);<br />
((ComboBox)myArrayList[0]).DataSource = aComparisonList_Strings;<br />
((ComboBox)myArrayList[0]).SelectedIndexChanged += new EventHandler(cmbComparison_SelectedIndexChanged);<br />
<br />
myForm.Controls.Add((ComboBox)myArrayList[1]);<br />
((ComboBox)myArrayList[1]).DataSource = aComparisonList_Strings;<br />
((ComboBox)myArrayList[1]).SelectedIndexChanged += new EventHandler(cmbComparison_SelectedIndexChanged);<br />
<br />
myForm.Controls.Add((ComboBox)myArrayList[2]);<br />
((ComboBox)myArrayList[2]).DataSource = aComparisonList_Strings;<br />
((ComboBox)myArrayList[2]).SelectedIndexChanged += new EventHandler(cmbComparison_SelectedIndexChanged);<br />


When the user chooses an item in the first combo box control, the SelectedIndex changes for ALL THREE CONTROLS. That's not what I want; I just want the three controls to share a datasource and an event handler. What am I doing wrong?
AnswerRe: sharing an event handler, not getting what I expect Pin
TJoe1-Oct-07 3:57
TJoe1-Oct-07 3:57 
GeneralRe: sharing an event handler, not getting what I expect Pin
JoeRip1-Oct-07 4:02
JoeRip1-Oct-07 4:02 
GeneralRe: sharing an event handler, not getting what I expect Pin
JoeRip1-Oct-07 4:15
JoeRip1-Oct-07 4:15 
GeneralRe: sharing an event handler, not getting what I expect Pin
TJoe1-Oct-07 4:30
TJoe1-Oct-07 4:30 
GeneralRe: sharing an event handler, not getting what I expect Pin
Luc Pattyn1-Oct-07 4:35
sitebuilderLuc Pattyn1-Oct-07 4:35 
GeneralRe: sharing an event handler, not getting what I expect Pin
JoeRip1-Oct-07 4:41
JoeRip1-Oct-07 4:41 
GeneralRe: sharing an event handler, not getting what I expect Pin
Luc Pattyn1-Oct-07 5:49
sitebuilderLuc Pattyn1-Oct-07 5:49 
GeneralRe: sharing an event handler, not getting what I expect Pin
TJoe1-Oct-07 5:56
TJoe1-Oct-07 5:56 
GeneralRe: sharing an event handler, not getting what I expect Pin
JoeRip1-Oct-07 5:57
JoeRip1-Oct-07 5:57 
GeneralRe: sharing an event handler, not getting what I expect [modified] Pin
Luc Pattyn1-Oct-07 6:03
sitebuilderLuc Pattyn1-Oct-07 6:03 
GeneralRe: sharing an event handler, not getting what I expect Pin
TJoe1-Oct-07 4:50
TJoe1-Oct-07 4:50 
QuestionProblem with macros Pin
yadlaprasad1-Oct-07 3:29
yadlaprasad1-Oct-07 3:29 
AnswerRe: Problem with macros Pin
TJoe1-Oct-07 3:48
TJoe1-Oct-07 3:48 
Questionhelp with code to implement a calculator.... Pin
MinhajuddinK1-Oct-07 3:25
MinhajuddinK1-Oct-07 3:25 
AnswerRe: help with code to implement a calculator.... Pin
led mike1-Oct-07 4:43
led mike1-Oct-07 4:43 
AnswerRe: help with code to implement a calculator.... Pin
Luc Pattyn1-Oct-07 4:55
sitebuilderLuc Pattyn1-Oct-07 4:55 
GeneralRe: help with code to implement a calculator.... Pin
MinhajuddinK1-Oct-07 7:32
MinhajuddinK1-Oct-07 7:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.