[請益] ControlCollection 與 Table的問題

看板C_Sharp (C#)作者 (我要拿Ph.D.!!!)時間18年前 (2007/05/21 23:46), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/1
程式碼大約如下 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

05/22 02:28, , 1F
以前也遇到這樣,好像在treeview或TableCell,忘了,不知原理
05/22 02:28, 1F
文章代碼(AID): #16KRxWRJ (C_Sharp)
文章代碼(AID): #16KRxWRJ (C_Sharp)