[Mono-winforms-list] NumericUpDown event problem

Brian Pickles brian at bsquaredsen.co.uk
Thu Mar 16 12:28:43 EST 2006


Paul,

On MS NetFramework 2 with VS 2005 you get 1 line written on the console for
every click on the control - fires once per click.

Brian

On 3/16/06, Paul <paul at all-the-johnsons.co.uk> wrote:
>
> Hi,
>
> I have a very simple Winform - it consists on a single NumericUpDown
> button with the ValueChanged event set onto the buttons.
>
> I'm currently seeing though that the event is being triggered twice. Can
> someone confirm this behaviour so I can enter it into bugzilla?
>
> using System;
> using System.Drawing;
> using System.Windows.Forms
>
> class simpletest : Form
> {
>   private NumericUpDown number;
>
>   public simpletest()
>   {
>      number = new NumericUpDown();
>      number.Location = new Point(12, 12);
>      number.Name = "numberbox";
>      number.Size = new Size(50, 23);
>      number.ValueChanged += new EventHandler(number_ValueChanged);
>
>      AutoScaleBaseSize = new Size(5, 13);
>      ClientSize = new Size (80, 40);
>      Control.Add(number);
>      Name = "simpletest"
>      Text = "NumericUpDown text";
>   }
>
>   private void number_ValueChanged(object sender, System.EventArgs e)
>   {
>     Console.WriteLine("Event triggered happily");
>   }
>
>   public static void Main()
>   {
>     simpletest t = new simpletest();
>     Application.Run(t);
>   }
> }
>
> You should find that when compiled, the event is called twice instead of
> once. I've only tested this under Mono (compiled from source at 16:00hrs
> GMT), so don't know what will happen under .NET
>
> TTFN
>
> Paul
>
> --
> "ein zu starker starker Anblick kann Sie toten. Sie gegen gerade uber
> den Rand mit dem festen Wissen des Wege vor Ihnen" - Linus Tordvals
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
>
> iD8DBQBEGZoKusSVe5EZv3wRAsFlAJ0fyrOF6cUz3DMLRoewePvU5L/kQwCgnSxe
> qyQ8u7ZNMfirHLAdpK5iPPU=
> =7M3U
> -----END PGP SIGNATURE-----
>
>
> _______________________________________________
> Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-winforms-list
>
>
>


--
Brian Pickles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20060316/64779d7b/attachment.html


More information about the Mono-winforms-list mailing list