回覆列表
-
1 # 大慄樹傳播
-
2 # 滴逃逃
"先建個圖片框Picture1 然後把下面的程式替換你原來的Command1_click()即可
Private Sub Command1_Click()
Picture1.Cls
r = 1
Do While r
c = 10 - r
s = 1
Do While s
Picture1.Print Tab(s + c); "*";
s = s + 1
Loop
r = r + 1
Loop
End Sub
1234567891011121314"先建個圖片框Picture1 然後把下面的程式替換你原來的Command1_click()即可Private Sub Command1_Click() Picture1.Cls r = 1 Do While r <= 5 c = 10 - r s = 1 Do While s <= 2 * r - 1 Picture1.Print Tab(s + c); "*"; s = s + 1 Loop r = r + 1 LoopEnd Sub追問: 那前景色 背景色 怎麼設定?追答:123456789101112131415161718192021222324252627282930313233343536Private Sub Form_Load() List1.AddItem "紅色" List1.AddItem "綠色" List1.AddItem "藍色" List1.AddItem "黃色" List2.AddItem "紅色" List2.AddItem "綠色" List2.AddItem "藍色" List2.AddItem "黃色"End SubPrivate Sub List1_Click() Select Case List1.Text Case "紅色" Picture1.ForeColor = vbRed Case "綠色" Picture1.ForeColor = vbGreen Case "藍色" Picture1.ForeColor = vbBlue Case "黃色" Picture1.ForeColor = vbYellow End Select Command1_ClickEnd SubPrivate Sub List2_Click() Select Case List2.Text Case "紅色" Picture1.BackColor = vbRed Case "綠色" Picture1.BackColor = vbGreen Case "藍色" Picture1.BackColor = vbBlue Case "黃色" Picture1.BackColor = vbYellow End Select Command1_ClickEnd Sub要是前景色 背景色 也要設定 我看你圖片上的程式碼 是不對的 你把這個內碼表貼進去 再試試 把你的那個什麼 紅色_click 和 list1_click 先全刪掉