Re: [問題] 請問listbox問題
看板C_Sharp (C#)作者deduce (http://punk.tw/ )時間18年前 (2007/09/10 14:12)推噓1(1推 0噓 0→)留言1則, 1人參與討論串2/2 (看更多)
簡單寫的話大概是這樣(當然要記得新增事件)
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
ListBox list = sender as ListBox;
MessageBox.Show(list.SelectedItem.ToString());
}
事實上這樣的寫法有瑕疵,不過你應該就有方向了:) 再根據你的需求去撰寫吧
※ 引述《liptonbin (wind)》之銘言:
: (不好意思我是新手)
: 請問listbox能不能
: 偵測使用者按一下(list1或list2或..list5)後
: 然後可以偵測使用者按了哪一個listbox
: 然後跳出一個視窗顯示使用者是按哪個list(list1~list5)呢?
: listbox:
: ----------------
: | list1 |
: | list2 |
: | list3 |
: | list4 |
: | list5 |
: ----------------
: 謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 125.232.198.223
推
09/11 12:22, , 1F
09/11 12:22, 1F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章