开发者

serialization of checkbox

Hi i have a couple of checkboxes, how do i go about serialize them?

I have a class that declares other variables to be serialized:

public class FormSaving
        {
            public string Majorversion
            {
                get;
                set;
            }
            public string Minorversion
            {
                get;
                set;
            }
            public int Buildstartingmail
            {
                get;
                set;
            }

where my Buildstartingmail is to be assigned to the BuildstartingmailcheckBox.

how should i do it?

i was thinking of using something like

abc.Buildstartingmail = BuildstartingmailcheckBox.SelectedIndex

but there is no such o开发者_运维问答ption as "SelectedIndex"


There are plenty solutions :

  1. You can save checkbox's index in Conrol collection
  2. You can store checkboxes in dictinary and save keys
  3. You can save checkbox's name
  4. You can use Tag property of checkbox to store unique id and then save that id
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜