[Mono-bugs] [Bug 349364] ComboBox: ValueMemeber not changed
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Sun Jan 6 20:06:35 EST 2008
https://bugzilla.novell.com/show_bug.cgi?id=349364
User calberto.cortez at gmail.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=349364#c2
--- Comment #2 from Carlos Alberto Cortez <calberto.cortez at gmail.com> 2008-01-06 18:06:34 MST ---
// Simpler sample -
// 1. Change text in textbox
// 2. Click the button
// 3. The data source should be the new text, not the previous one
using System;
using System.Drawing;
using System.Windows.Forms;
class Pal
{
string name;
public string Name {
get {
return name;
}
set {
name = value;
}
}
}
public class Test : Form
{
TextBox name_box;
static void Main ()
{
Application.Run (new Test ());
}
public Test ()
{
Pal pal = new Pal ();
pal.Name = "mono";
name_box = new TextBox ();
name_box.Location = new Point (5, 5);
name_box.DataBindings.Add (new Binding ("Text", pal, "Name"));
Button button = new Button ();
button.Text = "Show source value";
button.Size = new Size (120, 45);
button.Location = new Point (5, name_box.Bottom + 10);
button.Click += delegate (object obj, EventArgs args)
{
MessageBox.Show (pal.Name);
};
Controls.AddRange (new Control [] {name_box, button});
}
}
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the mono-bugs
mailing list