[問題] 請問該怎麼讓Lable變亂數?
小妹是新手,不知道這樣問法對不對~
我要做一個表單,
label1 + label2 = textbox(這邊讓人輸入)
檢查[button] (檢查答案是否正確)
下一題[button] (讓label1與label2重新產生亂數)
離開[button] (回到上一個表單)
我想請問,讓label1與label2產生亂數(1,10)該怎麼寫?
應該是在點擊"下一題"之後發生的事件對嗎?
以下是我的寫法(不過是錯的,該怎麼改呢?)
Random a=new Random();
label1.Text=a.Next(1,10);
熬夜寫著昨天才知道"今天"該交的作業 > < 謝謝大家~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.70.120.167
※ 編輯: irismallove 來自: 203.70.120.167 (04/13 02:22)
→
04/13 02:25, , 1F
04/13 02:25, 1F
※ 編輯: irismallove 來自: 203.70.120.167 (04/13 02:29)
→
04/13 02:33, , 2F
04/13 02:33, 2F
→
04/13 02:39, , 3F
04/13 02:39, 3F
→
04/13 02:44, , 4F
04/13 02:44, 4F
※ 編輯: irismallove 來自: 203.70.120.167 (04/13 02:57)
推
04/13 07:03, , 5F
04/13 07:03, 5F
推
04/14 18:32, , 6F
04/14 18:32, 6F
→
04/15 12:40, , 7F
04/15 12:40, 7F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):