c# Programming Glossary: event
How to stop BackgroundWorker on Form's Closing event? http://stackoverflow.com/questions/1731384/how-to-stop-backgroundworker-on-forms-closing-event to stop BackgroundWorker on Form's Closing event I have a form that spawns a BackgroundWorker that should update.. do this that I know is to actually cancel the FormClosing event. Set e.Cancel true if the BGW is still running and set a flag.. Then check that flag in the BGW's RunWorkerCompleted event handler and call Close if it is set. protected override void..
Automating the InvokeRequired code pattern http://stackoverflow.com/questions/2367718/automating-the-invokerequired-code-pattern how often one needs to write the following code pattern in event driven GUI code where private void DoGUISwitch cruisin for a..
Call ASP.NET Function From Javascript? http://stackoverflow.com/questions/3713/call-asp-net-function-from-javascript some Javascript and I have a submit button with an onClick event. Is it possible to call a method I created in ASP with Javascript's.. call a method I created in ASP with Javascript's onClick event c# asp.net javascript share improve this question Well if.. to your code file public void RaisePostBackEvent string eventArgument iii. In your onclick event in Javascript write the following..
WebBrowser Control in a new thread http://stackoverflow.com/questions/4269800/webbrowser-control-in-a-new-thread loaded so I never get to make use of the DocumentComplete event. How can I overcome this var item new ParameterizedThreadStart.. like WebBrowser. You won't get the DocumentCompleted event otherwise. Some sample code private void runBrowserThread Uri..
How do I make a textbox that only accepts numbers? http://stackoverflow.com/questions/463299/how-do-i-make-a-textbox-that-only-accepts-numbers done this kind of validation by overloading the KeyPress event and just removing characters which didn't fit the specification... the current value. Handle the appropriate keyboard events to prevent anything but numeric input. I've had success with.. current value. Handle the appropriate keyboard events to prevent anything but numeric input. I've had success with this two event..
VS2010 does not show unhandled exception message in a WinForms Application on a 64-bit version of Windows http://stackoverflow.com/questions/4933958/vs2010-does-not-show-unhandled-exception-message-in-a-winforms-application-on-a It swallows exceptions in the code that triggers the Load event. Preventing the debugger from seeing it and stepping in. This.. exceptions in the code that triggers the Load event. Preventing the debugger from seeing it and stepping in. This is apparently.. Thrown box for CLR exceptions. Write try catch in the Load event handler. Use Application.SetUnhandledExceptionMode UnhandledExceptionMode.CatchException..
When to use struct in C#? http://stackoverflow.com/questions/521298/when-to-use-struct-in-c to fill admittedly skewed due to logging and an OnResize event I added to the source however still impressive to fill 300k..
How to remove all event handlers from a control http://stackoverflow.com/questions/91778/how-to-remove-all-event-handlers-from-a-control to remove all event handlers from a control To create a new event handler on a.. remove all event handlers from a control To create a new event handler on a control you can do this c.Click new EventHandler.. or this c.Click mainFormButton_Click and to remove an event handler you can do this c.Click mainFormButton_Click But how..
How to wait for a BackgroundWorker to cancel? http://stackoverflow.com/questions/123661/how-to-wait-for-a-backgroundworker-to-cancel kludging it into while _worker.IsDone Application.DoEvents Problem with that is that is Application.DoEvents causes messages.. Problem with that is that is Application.DoEvents causes messages currently in the queue to be processed which.. re entrant . i would hope to use some solution involving Event synchronization objects where the code waits for an event that..
How does one animate a line on a canvas in C#? http://stackoverflow.com/questions/15469283/how-does-one-animate-a-line-on-a-canvas-in-c Width 75 Click button1_Click Canvas Window Button Click Event private void button1_Click object sender RoutedEventArgs e Line.. Click Event private void button1_Click object sender RoutedEventArgs e Line line new Line myCanvas.Children.Add line line.Stroke..
Using global keyboard hook (WH_KEYBOARD_LL) in WPF / C# http://stackoverflow.com/questions/1639331/using-global-keyboard-hook-wh-keyboard-ll-in-wpf-c-sharp of the keys is pressed down. summary public event RawKeyEventHandler KeyDown summary Fired when any of the keys is released... any of the keys is released. summary public event RawKeyEventHandler KeyUp #region Inner workings summary Hook ID summary.. delegate void KeyboardCallbackAsync InterceptKeys.KeyEvent keyEvent int vkCode summary Actual callback hook. remarks..
How can I programmatically generate keypress events in C#? http://stackoverflow.com/questions/1645815/how-can-i-programmatically-generate-keypress-events-in-c and Win32. To do this in WPF simply construct a KeyEventArgs and call RaiseEvent on the target. For example to send an.. this in WPF simply construct a KeyEventArgs and call RaiseEvent on the target. For example to send an Insert key KeyDown event.. target Keyboard.FocusedElement Target element var routedEvent Keyboard.KeyDownEvent Event to send target.RaiseEvent new KeyEventArgs..
What NoSQL solutions are out there for .NET? [closed] http://stackoverflow.com/questions/1777103/what-nosql-solutions-are-out-there-for-net Pub Sub push event based comms distributed locking CQRS Event Source Unique Id generator etc. Even if you're not using it..
When would you use delegates in C#? [closed] http://stackoverflow.com/questions/191153/when-would-you-use-delegates-in-c often didn't make sense. These days I use delegates for Event handlers for GUI and more Starting threads Callbacks e.g. for..
Set global hotkeys using C# http://stackoverflow.com/questions/2450373/set-global-hotkeys-using-c-sharp parent. if KeyPressed null KeyPressed this new KeyPressedEventArgs modifier key public event EventHandler KeyPressedEventArgs.. this new KeyPressedEventArgs modifier key public event EventHandler KeyPressedEventArgs KeyPressed #region IDisposable Members.. modifier key public event EventHandler KeyPressedEventArgs KeyPressed #region IDisposable Members public void Dispose..
What are the differences between delegates and events? http://stackoverflow.com/questions/29155/what-are-the-differences-between-delegates-and-events delegates glossary share improve this question An Event declaration adds a layer of abstraction and protection on the..
Why and How to avoid Event Handler memory leaks? http://stackoverflow.com/questions/4526829/why-and-how-to-avoid-event-handler-memory-leaks and How to avoid Event Handler memory leaks I just came to realize by reading some..
Memory Leak in C# http://stackoverflow.com/questions/620733/memory-leak-in-c-sharp garbage collection managed share improve this question Event Handlers are a very common source of non obvious memory leaks... collected. MyType object2 new MyType ... object1.SomeEvent object2.myEventHandler ... Should call this object1.SomeEvent.. MyType object2 new MyType ... object1.SomeEvent object2.myEventHandler ... Should call this object1.SomeEvent object2.myEventHandler..
ObservableCollection Doesn't support AddRange method, so I get notified for each item added, besides what about INotifyCollectionChanging? http://stackoverflow.com/questions/670577/observablecollection-doesnt-support-addrange-method-so-i-get-notified-for-each i Next OnCollectionChanged New NotifyCollectionChangedEventArgs NotifyCollectionChangedAction.Reset End Sub ''' summary.. i Next OnCollectionChanged New NotifyCollectionChangedEventArgs NotifyCollectionChangedAction.Reset End Sub ''' summary.. i Next OnCollectionChanged New NotifyCollectionChangedEventArgs NotifyCollectionChangedAction.Reset End Sub ''' summary..
No type inference with generic extension method http://stackoverflow.com/questions/7171067/no-type-inference-with-generic-extension-method method I have the following method public static TEventInvocatorParameters Until TEventInvocatorParameters TEventArgs.. method public static TEventInvocatorParameters Until TEventInvocatorParameters TEventArgs this TEventInvocatorParameters.. TEventInvocatorParameters Until TEventInvocatorParameters TEventArgs this TEventInvocatorParameters p Func TEventArgs bool..
Understanding events and event handlers in C# http://stackoverflow.com/questions/803242/understanding-events-and-event-handlers-in-c-sharp this is the prototype for creating an event public void EventName object sender EventArgs e What do event handlers do why.. for creating an event public void EventName object sender EventArgs e What do event handlers do why are they needed and how.. if we create a delegate void MyDelegate object sender EventArgs e it can only point to methods which return void and take..
Event Bubbling and MVP: ASP.NET http://stackoverflow.com/questions/8851933/event-bubbling-and-mvp-asp-net Bubbling and MVP ASP.NET I am trying to learn MVP It is using.. clicked for add days an event is raised myBtnAddDaysClickedEvent On the MonthViewControl there is a label that shows the month.. else User Control 1 @ Control Language C# AutoEventWireup true CodeFile CurrentTimeView.ascx.cs Inherits Views_CurrentTimeView..
|