Re: [問題] (sender As Object, e As EventArgs)

看板Programming作者 (Aaron)時間8年前 (2016/01/27 10:10), 編輯推噓2(200)
留言2則, 2人參與, 最新討論串2/2 (看更多)
※ 引述《Tripadvisor (探險家)》之銘言: : e As EventArgs,網路上查到 e是事件的參數 (完全看不懂) : 又說這個東西實際用不太到,可我真的很想知道EventArgs到底 : 是甚麼東西啊! 我可以用這個參數做甚麼 ? 很多阿!當你在某個方法(事件)。想額外取用特定物件的時候就很好用 我順手找了一下,MSDN已經很佛心的幫你列出來了,你只要點進去看就知道能幹啥用了 https://msdn.microsoft.com/en-us/library/system.eventargs(v=vs.110).aspx 以GridView來說,我會在RowCreated這個方法裡,透過GridViewRowEventArgs 來讓我判斷是不是表頭。然後我才能做一些額外的處理 其它就看你的情境了 :) protected void GridView2_RowCreated(object sender, GridViewRowEventArgs e) { TableCellCollection cells = e.Row.Cells; if (e.Row.RowType == DataControlRowType.Header) { cells[0].Text = "核心能力"; cells[1].Text = "比重"; cells[1].Attributes.Add("style", separateLine); } } -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.253.229.243 ※ 文章網址: https://www.ptt.cc/bbs/Programming/M.1453860652.A.AB1.html

01/28 18:53, , 1F
取 datagridview 的 rowindex 也很好用
01/28 18:53, 1F

02/01 19:19, , 2F
取鍵盤按鍵輸入就用的到
02/01 19:19, 2F
文章代碼(AID): #1Mg2Sign (Programming)
文章代碼(AID): #1Mg2Sign (Programming)