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

Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by Jon

Jon
Wed Jan 21 07:03:30 CST 2004

<discussion@discussion.microsoft.com> wrote:
> 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?

I'm not seeing the behaviour you've described. For instance:

using System;
using System.Windows.Forms;

class Test
{

static void Main()
{
NumericUpDown nud = new NumericUpDown();
nud.ValueChanged += new EventHandler (SayHello);
nud.Value = 20m;
}

static void SayHello (object sender, EventArgs e)
{
Console.WriteLine ("Hello");
}
}

displays "Hello" as expected.

Could you produce a similar short but complete program which
demonstrates the problem?

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by discussion

discussion
Wed Jan 21 07:14:19 CST 2004

I have the control in a PANEL and its got Panel.Enabled = false, then while
its in the false state I update the NumericUpDown.Value property and its
not firing. Does it only fire when its in an Enabled container?


"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.1a7888fcea752924989f04@msnews.microsoft.com...
> <discussion@discussion.microsoft.com> wrote:
> > 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?
>
> I'm not seeing the behaviour you've described. For instance:
>
> using System;
> using System.Windows.Forms;
>
> class Test
> {
>
> static void Main()
> {
> NumericUpDown nud = new NumericUpDown();
> nud.ValueChanged += new EventHandler (SayHello);
> nud.Value = 20m;
> }
>
> static void SayHello (object sender, EventArgs e)
> {
> Console.WriteLine ("Hello");
> }
> }
>
> displays "Hello" as expected.
>
> Could you produce a similar short but complete program which
> demonstrates the problem?
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too



Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by Jon

Jon
Wed Jan 21 07:20:11 CST 2004

<discussion@discussion.microsoft.com> wrote:
> I have the control in a PANEL and its got Panel.Enabled = false, then while
> its in the false state I update the NumericUpDown.Value property and its
> not firing. Does it only fire when its in an Enabled container?

If you look at the example I posted, it's not in a container at all.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by discussion

discussion
Wed Jan 21 07:38:29 CST 2004

Mine is.

"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.1a788ce590637c3989f06@msnews.microsoft.com...
> <discussion@discussion.microsoft.com> wrote:
> > I have the control in a PANEL and its got Panel.Enabled = false, then
while
> > its in the false state I update the NumericUpDown.Value property and
its
> > not firing. Does it only fire when its in an Enabled container?
>
> If you look at the example I posted, it's not in a container at all.
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too



Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by Jon

Jon
Wed Jan 21 07:38:21 CST 2004

<discussion@discussion.microsoft.com> wrote:
> Mine is.

How relevant is that? You asked whether the event only fired when it's
in an Enabled container. I pointed out that my example doesn't use a
container at all, so the answer to your question is clearly "no".

Now, as I said before, the best way of resolving this is for you to
come up with a short but complete program which demonstrates the
problem.

See http://www.pobox.com/~skeet/csharp/complete.html for what I mean by
that.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by Mick

Mick
Wed Jan 21 07:40:12 CST 2004

If the Container is disabled then the control is disabled. Disabled controls
normally do not fire events.

<discussion@discussion.microsoft.com> wrote in message
news:%23RjpxLC4DHA.1868@TK2MSFTNGP10.phx.gbl...
> Mine is.
>
> "Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
> news:MPG.1a788ce590637c3989f06@msnews.microsoft.com...
> > <discussion@discussion.microsoft.com> wrote:
> > > I have the control in a PANEL and its got Panel.Enabled = false, then
> while
> > > its in the false state I update the NumericUpDown.Value property and
> its
> > > not firing. Does it only fire when its in an Enabled container?
> >
> > If you look at the example I posted, it's not in a container at all.
> >
> > --
> > Jon Skeet - <skeet@pobox.com>
> > http://www.pobox.com/~skeet
> > If replying to the group, please do not mail me too
>
>



Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by discussion

discussion
Wed Jan 21 07:49:33 CST 2004

Its very relevant because the event is NOT firing with it in a disabled
container.



"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.1a78912bfe87384d989f07@msnews.microsoft.com...
> <discussion@discussion.microsoft.com> wrote:
> > Mine is.
>
> How relevant is that? You asked whether the event only fired when it's
> in an Enabled container. I pointed out that my example doesn't use a
> container at all, so the answer to your question is clearly "no".
>
> Now, as I said before, the best way of resolving this is for you to
> come up with a short but complete program which demonstrates the
> problem.
>
> See http://www.pobox.com/~skeet/csharp/complete.html for what I mean by
> that.
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too



Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by discussion

discussion
Wed Jan 21 07:52:22 CST 2004

Is that the desired logical behaviour because I am updating a value , its
logically changed but yet its not notified to all subscribers that its
changed. Doesnt smell right to me.




"Mick Doherty"
<EXCHANGE#WITH@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote in
message news:uIa5aQC4DHA.1428@TK2MSFTNGP12.phx.gbl...
> If the Container is disabled then the control is disabled. Disabled
controls
> normally do not fire events.
>
> <discussion@discussion.microsoft.com> wrote in message
> news:%23RjpxLC4DHA.1868@TK2MSFTNGP10.phx.gbl...
> > Mine is.
> >
> > "Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
> > news:MPG.1a788ce590637c3989f06@msnews.microsoft.com...
> > > <discussion@discussion.microsoft.com> wrote:
> > > > I have the control in a PANEL and its got Panel.Enabled = false,
then
> > while
> > > > its in the false state I update the NumericUpDown.Value property
and
> > its
> > > > not firing. Does it only fire when its in an Enabled container?
> > >
> > > If you look at the example I posted, it's not in a container at all.
> > >
> > > --
> > > Jon Skeet - <skeet@pobox.com>
> > > http://www.pobox.com/~skeet
> > > If replying to the group, please do not mail me too
> >
> >
>
>



Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by discussion

discussion
Wed Jan 21 07:57:59 CST 2004

As a workaround for this illogical behaviour, I fire the event myself after
i change the property.

Having them NOT fire events when disabled yet theyre still changing doesnt
seem logical at all. In fact I would say its giving incorrect values as the
subscribers think its one value yet its actually NOT that value because its
changed but no event to notify them.


<discussion@discussion.microsoft.com> wrote in message
news:Ow0yhTC4DHA.1636@TK2MSFTNGP12.phx.gbl...
> Is that the desired logical behaviour because I am updating a value , its
> logically changed but yet its not notified to all subscribers that its
> changed. Doesnt smell right to me.
>
>
>
>
> "Mick Doherty"
> <EXCHANGE#WITH@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote
in
> message news:uIa5aQC4DHA.1428@TK2MSFTNGP12.phx.gbl...
> > If the Container is disabled then the control is disabled. Disabled
> controls
> > normally do not fire events.
> >
> > <discussion@discussion.microsoft.com> wrote in message
> > news:%23RjpxLC4DHA.1868@TK2MSFTNGP10.phx.gbl...
> > > Mine is.
> > >
> > > "Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
> > > news:MPG.1a788ce590637c3989f06@msnews.microsoft.com...
> > > > <discussion@discussion.microsoft.com> wrote:
> > > > > I have the control in a PANEL and its got Panel.Enabled = false,
> then
> > > while
> > > > > its in the false state I update the NumericUpDown.Value property
> and
> > > its
> > > > > not firing. Does it only fire when its in an Enabled container?
> > > >
> > > > If you look at the example I posted, it's not in a container at all.
> > > >
> > > > --
> > > > Jon Skeet - <skeet@pobox.com>
> > > > http://www.pobox.com/~skeet
> > > > If replying to the group, please do not mail me too
> > >
> > >
> >
> >
>
>



Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by Jon

Jon
Wed Jan 21 08:02:44 CST 2004

<discussion@discussion.microsoft.com> wrote:
> Its very relevant because the event is NOT firing with it in a disabled
> container.

But it's not relevant to your question of whether the event is only
fired when it's in an Enabled container. My code answered that question
- the answer is "no".

However, here's another piece of code which shows that in fact a
control doesn't have to be enabled to fire an event, either:

using System;
using System.Windows.Forms;

class Test
{

static void Main()
{
NumericUpDown nud = new NumericUpDown();
nud.ValueChanged += new EventHandler (SayHello);
nud.Enabled = false;
nud.Value = 20m;
}

static void SayHello (object sender, EventArgs e)
{
Console.WriteLine ("Hello");
}
}

Until you produce a complete example, it's going to be very hard to
help you further.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by discussion

discussion
Wed Jan 21 08:14:42 CST 2004

My problem is its not firing when its in a disabled container, thats the
issue here.




"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.1a7896dea942dd61989f0a@msnews.microsoft.com...
> <discussion@discussion.microsoft.com> wrote:
> > Its very relevant because the event is NOT firing with it in a disabled
> > container.
>
> But it's not relevant to your question of whether the event is only
> fired when it's in an Enabled container. My code answered that question
> - the answer is "no".
>
> However, here's another piece of code which shows that in fact a
> control doesn't have to be enabled to fire an event, either:
>
> using System;
> using System.Windows.Forms;
>
> class Test
> {
>
> static void Main()
> {
> NumericUpDown nud = new NumericUpDown();
> nud.ValueChanged += new EventHandler (SayHello);
> nud.Enabled = false;
> nud.Value = 20m;
> }
>
> static void SayHello (object sender, EventArgs e)
> {
> Console.WriteLine ("Hello");
> }
> }
>
> Until you produce a complete example, it's going to be very hard to
> help you further.
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too



Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by Mick

Mick
Wed Jan 21 08:24:31 CST 2004

In fact I just tried it, and I was wrong, the event does fire. There must be
an error in your code.

<discussion@discussion.microsoft.com> wrote in message
news:Ow0yhTC4DHA.1636@TK2MSFTNGP12.phx.gbl...
> Is that the desired logical behaviour because I am updating a value , its
> logically changed but yet its not notified to all subscribers that its
> changed. Doesnt smell right to me.
>
>
>
>
> "Mick Doherty"
> <EXCHANGE#WITH@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote
in
> message news:uIa5aQC4DHA.1428@TK2MSFTNGP12.phx.gbl...
> > If the Container is disabled then the control is disabled. Disabled
> controls
> > normally do not fire events.
> >
> > <discussion@discussion.microsoft.com> wrote in message
> > news:%23RjpxLC4DHA.1868@TK2MSFTNGP10.phx.gbl...
> > > Mine is.
> > >
> > > "Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
> > > news:MPG.1a788ce590637c3989f06@msnews.microsoft.com...
> > > > <discussion@discussion.microsoft.com> wrote:
> > > > > I have the control in a PANEL and its got Panel.Enabled = false,
> then
> > > while
> > > > > its in the false state I update the NumericUpDown.Value property
> and
> > > its
> > > > > not firing. Does it only fire when its in an Enabled container?
> > > >
> > > > If you look at the example I posted, it's not in a container at all.
> > > >
> > > > --
> > > > Jon Skeet - <skeet@pobox.com>
> > > > http://www.pobox.com/~skeet
> > > > If replying to the group, please do not mail me too
> > >
> > >
> >
> >
>
>



Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by Jon

Jon
Wed Jan 21 08:27:28 CST 2004

<discussion@discussion.microsoft.com> wrote:
> My problem is its not firing when its in a disabled container, thats the
> issue here.

One last time: post your code. Just what's required, but in a complete
form so that I can compile and immediately run it.

Until you do so, I can't help you any further.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by discussion

discussion
Wed Jan 21 08:37:56 CST 2004

How much of an error can I have when I do a NumericUpDown.Value = someValue;
and the subscriber isnt getting it.

Im quite sure Im setting the .Value property and I am subscribed to the
ValueChanged event.

Could you explain where the error is and no im not giving out this
production code. Could be an issue with my version installed. I always
hated mishmashed upgrading scenarios.

In the InitializeComponent() form designer code its clearly subscribed my
event handler to the event.

When I start the form, its set the panel to enabled = false (from the
designer property) and I load up the value and set the .Value property, its
clearly NOT firing. I set a breakpoint and nope, nada.

I now call the event handler directly after setting the .Value property as a
workaround.


"Mick Doherty"
<EXCHANGE#WITH@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote in
message news:ual8LpC4DHA.1644@TK2MSFTNGP10.phx.gbl...
> In fact I just tried it, and I was wrong, the event does fire. There must
be
> an error in your code.
>
> <discussion@discussion.microsoft.com> wrote in message
> news:Ow0yhTC4DHA.1636@TK2MSFTNGP12.phx.gbl...
> > Is that the desired logical behaviour because I am updating a value ,
its
> > logically changed but yet its not notified to all subscribers that its
> > changed. Doesnt smell right to me.
> >
> >
> >
> >
> > "Mick Doherty"
> > <EXCHANGE#WITH@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote
> in
> > message news:uIa5aQC4DHA.1428@TK2MSFTNGP12.phx.gbl...
> > > If the Container is disabled then the control is disabled. Disabled
> > controls
> > > normally do not fire events.
> > >
> > > <discussion@discussion.microsoft.com> wrote in message
> > > news:%23RjpxLC4DHA.1868@TK2MSFTNGP10.phx.gbl...
> > > > Mine is.
> > > >
> > > > "Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
> > > > news:MPG.1a788ce590637c3989f06@msnews.microsoft.com...
> > > > > <discussion@discussion.microsoft.com> wrote:
> > > > > > I have the control in a PANEL and its got Panel.Enabled = false,
> > then
> > > > while
> > > > > > its in the false state I update the NumericUpDown.Value
property
> > and
> > > > its
> > > > > > not firing. Does it only fire when its in an Enabled container?
> > > > >
> > > > > If you look at the example I posted, it's not in a container at
all.
> > > > >
> > > > > --
> > > > > Jon Skeet - <skeet@pobox.com>
> > > > > http://www.pobox.com/~skeet
> > > > > If replying to the group, please do not mail me too
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by discussion

discussion
Wed Jan 21 08:40:12 CST 2004

Yeah sure let me just post my production code here. Do I look like a gimp?

If I get time I will try to repro it in a small project. I know what Im
doing and I can ssee clearly its not firing.



"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.1a789ca4216ed436989f0c@msnews.microsoft.com...
> <discussion@discussion.microsoft.com> wrote:
> > My problem is its not firing when its in a disabled container, thats the
> > issue here.
>
> One last time: post your code. Just what's required, but in a complete
> form so that I can compile and immediately run it.
>
> Until you do so, I can't help you any further.
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too



Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by Jon

Jon
Wed Jan 21 08:42:43 CST 2004

<discussion@discussion.microsoft.com> wrote:
> Yeah sure let me just post my production code here. Do I look like a gimp?

Did I ask you to post your production code?

> If I get time I will try to repro it in a small project. I know what Im
> doing and I can ssee clearly its not firing.

Reproducing it in a small project is exactly the thing to do.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by Saurabh

Saurabh
Wed Jan 21 08:45:10 CST 2004

> Yeah sure let me just post my production code here. Do I look like a gimp?

No you don't.
>
> If I get time I will try to repro it in a small project. I know what Im
> doing and I can ssee clearly its not firing.

Thats exactly what Jon had advised you to do when he sent you a link to his
website explaining what he means by a "short but complete" code, I agree
with him a 100% that if you write a short but complete code, you will be
able to track your problem for yourself.

People are ready to help here, just in case you wondered.

--Saurabh

>
>
>
> "Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
> news:MPG.1a789ca4216ed436989f0c@msnews.microsoft.com...
> > <discussion@discussion.microsoft.com> wrote:
> > > My problem is its not firing when its in a disabled container, thats
the
> > > issue here.
> >
> > One last time: post your code. Just what's required, but in a complete
> > form so that I can compile and immediately run it.
> >
> > Until you do so, I can't help you any further.
> >
> > --
> > Jon Skeet - <skeet@pobox.com>
> > http://www.pobox.com/~skeet
> > If replying to the group, please do not mail me too
>
>



Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by Mick

Mick
Wed Jan 21 08:57:27 CST 2004

> How much of an error can I have when I do a NumericUpDown.Value =
someValue;
> and the subscriber isnt getting it.
>
> Could you explain where the error is and no im not giving out this
> production code.

NumericUpDown.Value = 12;

If the Value was already 12 then the Value did not change, and subsequently,
the ValueChanged event will not fire.

I don't program in C#, I'm a VB.Net programmer,but to see the problem I
created a New windows form C# project.

I added a Panel to the form. I added a NumericUpDown Control to the Panel. I
set the Enabled property of the Panel to False. I added a button to the form
and added the following code.

private void button1_Click(object sender, System.EventArgs e)
{
this.numericUpDown1.Value +=1;
}
private void numericUpDown1_ValueChanged(object sender, System.EventArgs e)
{
MessageBox.Show("Hello!");
}



Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by Ignacio

Ignacio
Wed Jan 21 09:06:20 CST 2004

Hi,


You must have some error, if you do not post your code it's useless.

Ijust did a fast test, I created a form, put a panel, and inside it a
numericupdown, I set the panel as disabled.
also added a button withi this code:

this.numericupdown1.Value = 12;

IT DOES FIRE the event.

Below you will find my full code listing, I left it just as VS generated
it, for you to see it visually.

Cheers,

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


*************************************************** START OF CODE

using System;

using System.Drawing;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;

using System.Data;

namespace WindowsApplication1

{

public class Form1 : System.Windows.Forms.Form

{

private System.Windows.Forms.Panel panel1;

private System.Windows.Forms.NumericUpDown numericUpDown1;

private System.Windows.Forms.Button button1;

//private System.ComponentModel.Container components = null;

public Form1()

{

InitializeComponent();

}



#region Windows Form Designer generated code

/// <summary>

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

/// </summary>

private void InitializeComponent()

{

this.panel1 = new System.Windows.Forms.Panel();

this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();

this.button1 = new System.Windows.Forms.Button();

this.panel1.SuspendLayout();

((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(
);

this.SuspendLayout();

//

// panel1

//

this.panel1.Controls.Add(this.numericUpDown1);

this.panel1.Enabled = false;

this.panel1.Location = new System.Drawing.Point(64, 104);

this.panel1.Name = "panel1";

this.panel1.Size = new System.Drawing.Size(176, 96);

this.panel1.TabIndex = 0;

//

// numericUpDown1

//

this.numericUpDown1.Location = new System.Drawing.Point(48, 32);

this.numericUpDown1.Name = "numericUpDown1";

this.numericUpDown1.TabIndex = 0;

this.numericUpDown1.ValueChanged += new
System.EventHandler(this.numericUpDown1_ValueChanged);

//

// button1

//

this.button1.Location = new System.Drawing.Point(200, 48);

this.button1.Name = "button1";

this.button1.TabIndex = 1;

this.button1.Text = "button1";

this.button1.Click += new System.EventHandler(this.button1_Click);

//

// Form1

//

this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

this.ClientSize = new System.Drawing.Size(292, 273);

this.Controls.Add(this.button1);

this.Controls.Add(this.panel1);

this.Name = "Form1";

this.Text = "Form1";

this.panel1.ResumeLayout(false);

((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();

this.ResumeLayout(false);

}

#endregion

[STAThread]

static void Main()

{

Application.Run(new Form1());

}

private void numericUpDown1_ValueChanged(object sender, System.EventArgs e)

{

MessageBox.Show("hello");

}

private void button1_Click(object sender, System.EventArgs e)

{

this.numericUpDown1.Value = 12;

}

}

}







*************************************************** END OF CODE


<discussion@discussion.microsoft.com> wrote in message
news:eMvb$sC4DHA.1704@tk2msftngp13.phx.gbl...
> How much of an error can I have when I do a NumericUpDown.Value =
someValue;
> and the subscriber isnt getting it.
>
> Im quite sure Im setting the .Value property and I am subscribed to the
> ValueChanged event.
>
> Could you explain where the error is and no im not giving out this
> production code. Could be an issue with my version installed. I always
> hated mishmashed upgrading scenarios.
>
> In the InitializeComponent() form designer code its clearly subscribed my
> event handler to the event.
>
> When I start the form, its set the panel to enabled = false (from the
> designer property) and I load up the value and set the .Value property,
its
> clearly NOT firing. I set a breakpoint and nope, nada.
>
> I now call the event handler directly after setting the .Value property as
a
> workaround.
>
>
> "Mick Doherty"
> <EXCHANGE#WITH@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote
in
> message news:ual8LpC4DHA.1644@TK2MSFTNGP10.phx.gbl...
> > In fact I just tried it, and I was wrong, the event does fire. There
must
> be
> > an error in your code.
> >
> > <discussion@discussion.microsoft.com> wrote in message
> > news:Ow0yhTC4DHA.1636@TK2MSFTNGP12.phx.gbl...
> > > Is that the desired logical behaviour because I am updating a value ,
> its
> > > logically changed but yet its not notified to all subscribers that its
> > > changed. Doesnt smell right to me.
> > >
> > >
> > >
> > >
> > > "Mick Doherty"
> > > <EXCHANGE#WITH@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]>
wrote
> > in
> > > message news:uIa5aQC4DHA.1428@TK2MSFTNGP12.phx.gbl...
> > > > If the Container is disabled then the control is disabled. Disabled
> > > controls
> > > > normally do not fire events.
> > > >
> > > > <discussion@discussion.microsoft.com> wrote in message
> > > > news:%23RjpxLC4DHA.1868@TK2MSFTNGP10.phx.gbl...
> > > > > Mine is.
> > > > >
> > > > > "Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
> > > > > news:MPG.1a788ce590637c3989f06@msnews.microsoft.com...
> > > > > > <discussion@discussion.microsoft.com> wrote:
> > > > > > > I have the control in a PANEL and its got Panel.Enabled =
false,
> > > then
> > > > > while
> > > > > > > its in the false state I update the NumericUpDown.Value
> property
> > > and
> > > > > its
> > > > > > > not firing. Does it only fire when its in an Enabled
container?
> > > > > >
> > > > > > If you look at the example I posted, it's not in a container at
> all.
> > > > > >
> > > > > > --
> > > > > > Jon Skeet - <skeet@pobox.com>
> > > > > > http://www.pobox.com/~skeet
> > > > > > If replying to the group, please do not mail me too
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by Mick

Mick
Wed Jan 21 09:06:23 CST 2004

I forgot to say, "When compiled and run, there was no problem".

"Mick Doherty"
<EXCHANGE#WITH@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote in
message news:ejbSl7C4DHA.1728@TK2MSFTNGP09.phx.gbl...
> > How much of an error can I have when I do a NumericUpDown.Value =
> someValue;
> > and the subscriber isnt getting it.
> >
> > Could you explain where the error is and no im not giving out this
> > production code.
>
> NumericUpDown.Value = 12;
>
> If the Value was already 12 then the Value did not change, and
subsequently,
> the ValueChanged event will not fire.
>
> I don't program in C#, I'm a VB.Net programmer,but to see the problem I
> created a New windows form C# project.
>
> I added a Panel to the form. I added a NumericUpDown Control to the Panel.
I
> set the Enabled property of the Panel to False. I added a button to the
form
> and added the following code.
>
> private void button1_Click(object sender, System.EventArgs e)
> {
> this.numericUpDown1.Value +=1;
> }
> private void numericUpDown1_ValueChanged(object sender, System.EventArgs
e)
> {
> MessageBox.Show("Hello!");
> }
>
>



Re: ValueChanged event NOT being fired when setting NumericUpDown.Value property by Marco

Marco
Wed Jan 21 10:50:36 CST 2004

its always the same thing with this guy...
"Saurabh" <saurabh@nagpurcity.net> wrote in message
news:OJGOm1C4DHA.1948@TK2MSFTNGP12.phx.gbl...
> > Yeah sure let me just post my production code here. Do I look like a
gimp?
>
> No you don't.
> >
> > If I get time I will try to repro it in a small project. I know what Im
> > doing and I can ssee clearly its not firing.
>
> Thats exactly what Jon had advised you to do when he sent you a link to
his
> website explaining what he means by a "short but complete" code, I agree
> with him a 100% that if you write a short but complete code, you will be
> able to track your problem for yourself.
>
> People are ready to help here, just in case you wondered.
>
> --Saurabh
>
> >
> >
> >
> > "Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
> > news:MPG.1a789ca4216ed436989f0c@msnews.microsoft.com...
> > > <discussion@discussion.microsoft.com> wrote:
> > > > My problem is its not firing when its in a disabled container, thats
> the
> > > > issue here.
> > >
> > > One last time: post your code. Just what's required, but in a complete
> > > form so that I can compile and immediately run it.
> > >
> > > Until you do so, I can't help you any further.
> > >
> > > --
> > > Jon Skeet - <skeet@pobox.com>
> > > http://www.pobox.com/~skeet
> > > If replying to the group, please do not mail me too
> >
> >
>
>