473,404 Members | 2,137 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,404 software developers and data experts.

Events heirdom

Hi

I have 2 forms, like this:

Form2 : Form1

On Form1 I have a button1_Click event.

On Form2 no event is set.
When I Click button1 on Form2 the onClick event is fired two times. I
figured that its because Form2 is made out of Form1, so program actually
has two events, one on Form2 and second one on Form1.
Am i correct?

How can I prevent from firing onClick event second time?
bets regards
Mateusz [PEYN] Adamus

PS: How do you say in english something like this -> Form2 : Form1 ??
I got heirdom from some web dictionary but I'm not sure if this is
correct :-)
Nov 17 '05 #1
1 953
Hi,
PS: How do you say in english something like this -> Form2 : Form1 ??
Form2 inherits Form1 (the noun will be 'inheritance').
When I Click button1 on Form2 the onClick event is fired two times. I
It's a very strange behavior. All inherited stuff is not duplicated, if you
have an event in a base class, you will still have the same event in the
derived one. Just make sure you don't add a handler for button_Click in
Form2 to raise the onClick event if Form1 already does so.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"Mateusz [PEYN] Adamus" <pe************@tlen.pl> wrote in message
news:d6**********@nemesis.news.tpi.pl... Hi

I have 2 forms, like this:

Form2 : Form1

On Form1 I have a button1_Click event.

On Form2 no event is set.
When I Click button1 on Form2 the onClick event is fired two times. I
figured that its because Form2 is made out of Form1, so program actually
has two events, one on Form2 and second one on Form1.
Am i correct?

How can I prevent from firing onClick event second time?
bets regards
Mateusz [PEYN] Adamus

PS: How do you say in english something like this -> Form2 : Form1 ??
I got heirdom from some web dictionary but I'm not sure if this is correct
:-)


Nov 17 '05 #2

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

Similar topics

5
by: Vince C. | last post by:
Hi. I'd like to trap ADO Recordset object events in my ASP script (either VBS or JS, no preference). I've tried (in VBS) writing a Sub rs_RecordChangeComplete( adReason, cRecords, pError,...
8
by: Edward Diener | last post by:
Is it possible for a derived class to override a property and/or event of its base class ?
3
by: Sasha | last post by:
Hi everyone, Here is my problem: I have the following classes: - DataNode - this class is designed to hold some data and will be contained in a tree like data structure DataTree. When...
6
by: Saso Zagoranski | last post by:
Hi! How can I unregister all the events registered to a control? I have seen a piece of code in another thread, which gets all the registered handlers for a specific event. Let's say I have a...
14
by: JPRoot | last post by:
Hi I use the following syntax to have events inherited from base to child classes which works nicely (virtual and override keyword on events). But I am wondering if it is a "supported" way of using...
4
by: LP | last post by:
Hello! I am still transitioning from VB.NET to C#. I undertand the basic concepts of Delegates, more so of Events and somewhat understand AsyncCallback methods. But I need some clarification on...
11
by: Nicky Smith | last post by:
Hello, I'm studying a book on VB.net Win apps, and I'm reading a section on events and delegates and raising events. Is it just me, or is this not just subs dressed up as something else? I...
14
by: xoozlez | last post by:
Hi there, I have a registration form where I like to filter out the past events of 2007. This is the code I am using : strSQL = "SELECT EventID, EventName, EventDateBegin, EventDateEnd,...
1
by: swethak | last post by:
Hi, I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the...
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: 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...
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
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...
0
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...
0
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...
0
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...

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.