mardi 6 mars 2018

Binding WinForm CheckBox to a static boolean field?

I am trying to bind my winform checkbox CheckBoxUnderline to a public static field Underline. I figured out I could do something similar to this :

CheckBoxUnderline.DataBindings.Add("Checked", Data.Underline, "Underline");

But this doesn't work. When I access CheckBoxUnderline's Checked field I always get the default false I set before no matter if I check it or not.

How do you properly bind a WinForm CheckBox to a boolean field?




Aucun commentaire:

Enregistrer un commentaire