Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then 'ASCII 13正是 Enter字元
Gtext = Combo1.Text
If Combo1.ListCount > 0 Then
For N = 0 To Combo1.ListCount - 1
Combo1.ListIndex = N
If Gtext = Combo1 Then P = 1
Next
End If
If P = 0 And Trim(Gtext) <> "" Then
Combo1.AddItem Gtext, 0 '將要新增的資料放在第一位上
Combo1 = Gtext
End If
End If
End Sub
執行後會出現: 事件程序的宣告與同名事件的描述不相符
why 和解 謝謝