コード例 #1
0
 //------
 //constructor creates and loads the list box
 public ListChoice(Equities stks)
 {
     stocks             = stks.getNames();
     panel              = new Panel();
     list               = new ListBox();
     list.Location      = new Point(16, 0);
     list.Size          = new Size(120, 160);
     list.SelectionMode = SelectionMode.MultiExtended;
     list.TabIndex      = 0;
     panel.Controls.Add(list);
     for (int i = 0; i < stocks.Count; i++)
     {
         list.Items.Add(stocks[i]);
     }
 }
コード例 #2
0
 //------
 public CheckChoice(Equities stks)
 {
     stocks = stks.getNames();
     panel  = new Panel();
     boxes  = new ArrayList();
     //add the check boxes to the panel
     for (int i = 0; i < stocks.Count; i++)
     {
         CheckBox ck = new CheckBox();
         //position them
         ck.Location = new Point(8, 16 + i * 32);
         string stk = (string)stocks[i];
         ck.Text      = stk;
         ck.Size      = new Size(112, 24);
         ck.TabIndex  = 0;
         ck.TextAlign = ContentAlignment.MiddleLeft;
         boxes.Add(ck);
         panel.Controls.Add(ck);
     }
 }