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

Add ValueChanged event handler AFTER control is initialized

I want to add a ValueChanged event handler to a control. If I add the handler
during form construction then the ValueChanged handler gets called when the
control is initialized, and I don't want this. However I cannot find a place
during form initialization where I can add the handler AFTER the control has
been initialized.

So, how do I add a ValueChanged event handler to a control AFTER the control
has been initialized?

- Javaman
Nov 17 '05 #1
2 2627
Hi,

You can do so after InitializateComponents() is called in the constructor.

Additionally you could do so in the Load event of the form.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Javaman59" <Ja*******@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
I want to add a ValueChanged event handler to a control. If I add the
handler
during form construction then the ValueChanged handler gets called when
the
control is initialized, and I don't want this. However I cannot find a
place
during form initialization where I can add the handler AFTER the control
has
been initialized.

So, how do I add a ValueChanged event handler to a control AFTER the
control
has been initialized?

- Javaman

Nov 17 '05 #2
Thanks Ignacio,

In testing your solutions I've discovered that the root of my problem was a
programming error on my part. In fact ValueChanged is not normally called for
a control when the form and control are initialized.

Cheers,

Stephen

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

You can do so after InitializateComponents() is called in the constructor.

Additionally you could do so in the Load event of the form.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Javaman59" <Ja*******@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
I want to add a ValueChanged event handler to a control. If I add the
handler
during form construction then the ValueChanged handler gets called when
the
control is initialized, and I don't want this. However I cannot find a
place
during form initialization where I can add the handler AFTER the control
has
been initialized.

So, how do I add a ValueChanged event handler to a control AFTER the
control
has been initialized?

- Javaman


Nov 17 '05 #3

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

Similar topics

21
by: | last post by:
Hi, I am setting the NumericUpDown .Value property and the ValueChanged event is NOT being fired. Does this ONLY get fired when I change it on the UI and not programatically? Thanks
1
by: Divya | last post by:
Hello This is my 1st project where I have to create a Webcontrol. I have created a simple custom control with a button and 2 labels added to a panel. My problem is that the event handler that I...
1
by: Ryan Liu | last post by:
I notice System.Windows.Forms.NumericUpDown's ValueChanged event is not always fired, especially edit its text box directly. Is this a known bug or there is something I should pay attention for...
4
by: TS | last post by:
I am creating a User control and i create some dynamic controls in the init handler. one of the controls is a custom validator which i assign a serverValidate event handler. I usally always do my...
1
by: skhairnar | last post by:
Hi All, I am trying to write a validation rule for DateTimePicker, which will prevent user from selecting saturday or sunday as a value. For this I have added an event handler with following code:...
3
by: rfinch | last post by:
I'm trying to pass two values from client script (Javascript) to the code-behind for a page using three hidden fields - two to hold the values and a third to fire the ValueChanged event. I have...
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...
2
by: kpg* | last post by:
Hi all, asp.net 2.0 I'm using the login control with no frills to authenticate users. I want to add a value to the user's profile when the user successfully logs in, but I want to do this...
2
by: Steven | last post by:
Hello, I want to raise the ValueChanged event ONLY when i move the track bar manually, but not the value changed, how to do in the event below? thank you Private Sub TrackBar1_ValueChanged(ByVal...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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...

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.