473,387 Members | 1,504 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,387 software developers and data experts.

Delegation from within Event Handler

6
Hi,

I'm trying to create and show a form from an event handler (SMO complete event). I believe it's not working because the event is closing - If I put a messagebox after the invoke to keep it open it works (until the messagebox is OK'ed)

Any ideas on what I can do?


Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub CompleteEventHandler(ByVal sender As Object, ByVal e As Microsoft.SqlServer.Management.Common.ServerMessageEventArgs)
  3.         Dim del = New MyDelSub(AddressOf RandomPopUp)
  4.         del.Invoke()
  5.     End Sub
  6.  
  7.     Private Delegate Sub MyDelSub()
  8.     Private Sub RandomPopUp()
  9.         Dim TempMessage As New frmNotification
  10.         TempMessage.lblMessage.Text = "(Complete)"
  11.         TempMessage.Show()
  12.     End Sub
  13.  
  14.  
  15.  
Aug 24 '10 #1
0 696

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Pavils Jurjans | last post by:
Hallo, I have been programming for restricted environments where Internet Explorer is a standard, so I haven't stumbled upon this problem until now, when I need to write a DOM-compatible code. ...
1
by: malcolm | last post by:
Is there a way to test to see if an event handler hasn't already been added to an event handler listener object? This is what I am doing now as a hack: dataView.ListChanged -= new...
2
by: Wee Bubba | last post by:
my user control (usercontrol1.ascx) is added dynamically into a placeholder on page_load. within usercontrol1.ascx there is a button. When a user presses this button I want the page to reload with...
0
by: Novice | last post by:
Hey all, I've already posted this question and two posters offered suggestions and they worked - but now I would like to know why - and if possible the answer to a second question. Here is my...
5
by: james | last post by:
Hello, I am having a little trouble creating an event handler for a context menu toolstripmenuitem. I've seen various tutorials and so on, but I keep getting a bit stuck! So far I have a second...
2
by: moondaddy | last post by:
I have an asp.net 2.0 application and put a html button on a web page. I double clicked on the button and it crated the event handler for me and created the stub js function for it like this: ...
2
by: frank.elk | last post by:
Hello I would like to trigger an event from within my code. I have a MouseUp event handler and I need to call a paint event handler from within the former, to update the form of my application....
2
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite...
1
by: Mike Thompson | last post by:
I have an event handler defined within a class. It has the following signature: static void XYZ_EventHandler (object sender, XYZEventArgs e) From within this event handler, I want to access...
4
by: =?Utf-8?B?TmF2YW5lZXRoLksuTg==?= | last post by:
Hi all, Recently I found an interesting question on C# forums about clearing event handlers of an event. I tried to give it a solution, but failed. I am interested to know how you guys take...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.