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

Add Event that is viewable..

How do I add an event to an object (in this case a form) that is viewable in
the GUI of VS2005?

i.e. if I add the following to a form:
public delegate void TestDelegate(int Test);

public static event TestDelegate TestEvent;

For some reason I can't see this new event in the Properties/Events of the
VS2005 GUI... How can I make it appear there?
Aug 18 '06 #1
2 1172
Remove the "event" keyword from the second line of code.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Brett Wickard" wrote:
How do I add an event to an object (in this case a form) that is viewable in
the GUI of VS2005?

i.e. if I add the following to a form:
public delegate void TestDelegate(int Test);

public static event TestDelegate TestEvent;

For some reason I can't see this new event in the Properties/Events of the
VS2005 GUI... How can I make it appear there?
Aug 18 '06 #2
Woah - now your exposing all sorts of access that people generally hide
via the "event" accessors...

My first guess would be that the IDE only supports adding *instance*
events, not *static* events, which makes a lot of sense for forms.

My second guess would be that the IDE wants you to follow the standard
pattern:

public delegate void SomeTestHandler(object sender, SomeTestEventArgs
args);

where SomeTestEventArgs : EventArgs, probably exposing the integer as a
property:

public class SomeTestEventArgs : EventArgs {
public readonly int TestValue; // probably better a property
public SomeTestEventArgs(int testValue) {TestValue=testValue;}
}

Note that in 2.0 you can also then dispose of the custom delegate,
using instead

public event EventHandler<SomeTestEventArgsTestEvent;

Marc

Aug 18 '06 #3

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

Similar topics

2
by: rmeyer233 | last post by:
I'm a bit of a newb, so bear with me folks.. I've created a simple web app for users to upload images, which are then copied to a web directory using the PEAR HTTP_Upload library (which uses...
4
by: F. Da Costa | last post by:
Hi all, I'm looking for a way to actually show a selected row *in* the viewable area on the screen. Situation: 1. Large table with autoComplete search fuctionality 2. On clickin a button (or...
1
by: B | last post by:
Greetings, I have a web page with a table that does not fit on the screen. Thus, horizontal scrollbars appear. What I would like to do is add a caption text above it. However, I would like...
14
by: Gérard Talbot | last post by:
I personally disagree with the Viewable in Any browser campain. The site is frankly outdated, seems to be no longer maitained, has several recommendations that don't make a lot of sense anymore. In...
0
by: yuyu | last post by:
Hi. I have a derived TextBox that draws a button on the right of the control within the textbox when focused. When I key in the text, how can I set the viewable text not to pass the button? ...
9
by: Lee Hopkins | last post by:
We have just purchased .net ent. edition for our company. I have installed .net on my desktop where I do the developing of our aspx, and vb.net applications. the Network people installed the 1.1...
8
by: Ashish | last post by:
Is there any way to make my transcripts of the DB2 certifications viewable for public ? Right now only I can view my scores , but I am unable to give an access to let others view my scores... Is...
4
by: somnamblst | last post by:
I am asking this in javascript and not actionscript because I think the js portion more crucial. I have a viewable area in a SWFcalled box_mc on frame1 that is 300x100 until a rollOver event when it...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
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...

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.