473,396 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Stop unwanted event handling for combo boxes

I'm using C# to build an application.

1) I have two windows forms, A and B.
2) A uses a DataSet read from SQL server.
3) The user presses a button on A to open B.
4) B is passed a pointer to the DataSet.
5) While in B, tables in the Dataset are bound to combo
box controls.
6) While in B, I add handlers to capture the
SelectedIndexChanged event
7) The user closes B
8) The user presses a button on A that causes the
DataSet to reload.
9) [THE PROBLEM!!!] - The event handlers that I set up
for B are still being called!


Questions:
A) Is there a way I can simply delete the form B object?
I tried calling B.Dispose() but it doesn't get rid of B

B) Is there a recommended method to deterministically
disable event handlers when a form is closed?

C) Why should this even occur? It just doesn't make sense
that the handler for a button that is on a closed form is
active when the form is closed?

Thanks,

Scott
Jul 19 '05 #1
0 1794

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
0
by: Scott | last post by:
I'm using C# to build an application. 1) I have two windows forms, A and B. 2) A uses a DataSet read from SQL server. 3) The user presses a button on A to open B. 4) B is passed a pointer to...
1
by: Robert | last post by:
Every thing worked fine until all of a sudden, I get the following error whenever I try to do anything on one of my forms that calls an Event Procedure. I get the error as soon as the form opens...
3
by: msch-prv | last post by:
I am fairly new to PHP. I started creating a variety of classes (calendars, input forms, combo boxes, etc. ) but I am running into code overhead when I integrate these objects (testing for POST,...
1
by: dana1 | last post by:
I have a form with several combo boxes in the header used to determine the records that will be displayed on the form. When I tab or enter from the last combo box in the header, I want the focus to...
1
by: Harry2007 | last post by:
Currently, my Access 2003 form only has 3 combo boxes with data sourced from different tables, a command button, a subform and 2 textboxes. Funny thing happened when I press the Enter key on the...
2
by: someshbakliwal | last post by:
Hi, I have created some autopopulating combo boxes on my HTML page (script- Javascript). so these combo boxes are autopopulated with choices made in previous combo boxes. The problem I am facing is...
3
by: tkip | last post by:
Hi Guys! It's been a while I haven't asked questions here mostly because things are working fairly well and I have been able to fix things up on my own. But this seemingly simply task confused...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.