看板 C_Sharp 關於我們 聯絡資訊
程式碼大約如下 ControlCollection cc = new ControlCollection(); //略... for(...) { TableCell tc = new TableCell(); //略.... CheckBox tempcheckbox = new CheckBox(); //寫法一 this.cc.Add(tempcheckbox); tc.Controls.Add(tempcheckbox); //寫法二 tc.Controls.Add(tempcheckbox); this.cc.Add(tempcheckbox); //略... } 其中寫法一在網頁上會正常顯示 寫法二(顛倒過來而已),checkbox會消失不見 有沒有人能說明一下這其中有何差別... 有點小詭異 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.133.110.47
tomex:以前也遇到這樣,好像在treeview或TableCell,忘了,不知原理 05/22 02:28