473,805 Members | 1,887 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MustOverride Event

All,

Is there a way to force a derived class to contain an event. I have done
this with methods (i.e. Protected MustOverride Sub Test), but can I do
something similar with an event (Protected MustOverride Event MyEvent
doesn't work for obvious reasons)?

Thanks in advance.
Dave
Nov 18 '05 #1
2 1472
If you created an interface, and had the derived class impliment the
interface, then you could force the derived class to have the event in
question.

Did that make sense?

Michael
"Dave Wurtz" <da************ *******@asdsoft ware.com> wrote in message
news:3f******** @news.splitrock .net...
All,

Is there a way to force a derived class to contain an event. I have done
this with methods (i.e. Protected MustOverride Sub Test), but can I do
something similar with an event (Protected MustOverride Event MyEvent
doesn't work for obvious reasons)?

Thanks in advance.
Dave

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 12/2/2003
Nov 18 '05 #2
Michael,

Thanks for the suggestion. I was hoping that I wouldn't have to create an
interface just for this, however.

Dave

"Michael Pearson" <mi************ ************@te levox.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
If you created an interface, and had the derived class impliment the
interface, then you could force the derived class to have the event in
question.

Did that make sense?

Michael
"Dave Wurtz" <da************ *******@asdsoft ware.com> wrote in message
news:3f******** @news.splitrock .net...
All,

Is there a way to force a derived class to contain an event. I have done this with methods (i.e. Protected MustOverride Sub Test), but can I do
something similar with an event (Protected MustOverride Event MyEvent
doesn't work for obvious reasons)?

Thanks in advance.
Dave

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 12/2/2003

Nov 18 '05 #3

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

Similar topics

0
7050
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
1
1527
by: Eidolon | last post by:
I am looking to have a base class which provides that all inherited classes MUST have some property, but that they can each define it as whatever type they want. So maybe three class inherit from the base class, each MUST have a property, but one defines it as OracleType, one as SqlType and one as DB2Type, for example. I know i can just declare it as Object, and then have the classes each do typechecks on value assignment, but this is...
18
2892
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 originator) and e (event arguments). I know how to get typeof (sender) to determine what form or...
8
2449
by: Dave Wurtz | last post by:
All, Is there a way to force a derived class to contain an event. I have done this with methods (i.e. Protected MustOverride Sub Test), but can I do something similar with an event (Protected MustOverride Event MyEvent doesn't work for obvious reasons)? Thanks in advance. Dave
7
9300
by: Iain Mcleod | last post by:
Hi This must be an often encountered problem. I want to declare an abstract class or an interface with nothing but several static constants so that I can use polymorphism when I call each of them from my code. My stab at the problem is shown below. Can anyone suggest what my most efficient workable solution would be (i.e. I don't want to have to create instances of the classes as they will only store constant information and I would...
7
1888
by: Raterus | last post by:
I've got a good question about object-oriented programming, I hope I can explain it well enough. I'm creating a UserManager, which I'm going to inherit from so different applications can share common methods. Public MustInherit Class UserManager Public MustOverride Sub AddUser(usr as InternetUser) End Class Public Class InternetUser Public username as string End Class
41
4338
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. I'm not using the VB toolbar because of limitations in changing things like backcolor (I can't get...
9
2475
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 levels of inherited objects that need to have these pre / post events executed before and after the...
0
1027
by: Altman | last post by:
I have created a class that has a mustoverride method. When I inherit this class VB automatically creates the overrides function for it. I was wondering if there was a way to have VB include a comment when it automatically creates the method. Example "TODO: you must ........"
0
10609
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10360
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10105
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9185
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7646
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5542
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3845
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3007
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.