473,513 Members | 2,552 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Event preemption

Hi all,

I am seeing some unexpected behaviour in a single threaded winforms app
and was hoping someone could explain what is going on.
I have two events attached to a chart control on my form, and during
execution one event seems to preempt the execution of the other.

My code looks similar to the following:

private void MyChart_Click(object sender, System.EventArgs e)
{
....do some logic tests
GetSomeData();
}

// This event is attached to the context menu for the chart control.
private void DrillDownMenuItem_Click(object sender, System.EventArgs e)
{
....do stuff
}

private DataSet GetSomeData()
{
....setup tasks
....Call web service
....finish stuff
}

What happens is that when I right click and select drill down from the
chart controls context menu the MyChart_Click event fires and does the
logic tests. Execution then steps into the GetSomeData method, but when
the web service is called execution jumps to the
DrillDownMenuItem_Click event. This runs to completion then execution
returns to the GetSomeData method which finishes and finally returns to
the MyChart_Click event handler.
Can someone explain why this is so?

Thanks very much,
James

Nov 16 '05 #1
2 1525
James <no**********@mailinator.com> wrote:
I am seeing some unexpected behaviour in a single threaded winforms app
and was hoping someone could explain what is going on.
I have two events attached to a chart control on my form, and during
execution one event seems to preempt the execution of the other.

My code looks similar to the following:


Rather than similar code, could you post a short but complete program
which demonstrates the problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
Hi Jon,

Thanks very much for your reply.

I have figured out the problem myself now. It turns out it is a bug in
the third party control I am using. I am making the vendor aware of the
problem now.
Nice posting guidelines by the way ;-)

Regards,
James Fitzsimons

Nov 16 '05 #3

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

Similar topics

0
7009
by: Andy Read | last post by:
Hello all, I have the requirement to produce source code that produces an object hierarchy. Example: Root | Folder 1
18
2852
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 that applies to all these events, but I need to have specific code execute when the form closes. The properties for this method are sender (the...
8
6076
by: Mark | last post by:
Hi, I'm looking for some ideas on how to build a very simple Event processing framework in my C++ app. Here is a quick background ... I'm building a multithreaded app in C++ (on Linux) that uses message queues to pass pointers to Events between threads. In my app there are simple events that can be defined using an enum (for example an...
13
3479
by: Charles Law | last post by:
Mr "yEaH rIgHt" posted the following link about a week ago in answer to my question about removing event handlers. > http://www.vbinfozine.com/t_bindevt.shtml Following on from that post, the following issues still exist. The article shows how to find methods on a receiver that match the pattern OnXXXX given the sender. It loops through...
12
4103
by: Jack Russell | last post by:
My unstanding of all VB up to and including vb6 is that an event could not "interrupt" itself. For instance if you had a timer event containing a msgbox then you would only get one message. However in vb.net you get continual messages (even setting the system modal property). Firstly, are these two assumptions right and if so what is...
41
4243
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based on some initialization information obtained elsewhere. Basically, I'm going to create my own dynamic toolbar where the toolbarbuttons can change. ...
0
963
by: Jurgen Haan | last post by:
Hey hey all.. Linux 2.6.x has the ability to run with or without a preemptive scheduler.. What impact does preemtpion have on DB2? afaik servers run best without preemption and desktops run best with preemption (nice smooth mouse). Because it occured to me that the default SLES9 kernel had preemption enabled... I had to deactivate this...
9
2457
by: jeff | last post by:
New VB user...developer... Situation...simplified... - I want to wrap a pre and post event around a system generated where the pre-event will always execute before the system event and the post event will always execuate after the system is completed... - I want to wrap this functionality in a framework, so I could possibly have 3 or 4...
0
746
by: Gabriel Genellina | last post by:
En Tue, 20 May 2008 01:18:29 -0300, PARIMALA KALAVALA <parimala.kalavala@gmail.comescribió: I suggest you ask in a linux group. There is nothing Python specific in this question. -- Gabriel Genellina
0
7270
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7565
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7128
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7543
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5103
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3255
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3242
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
473
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.