Dim items = e.Sender.ItemsIf items.Contains(e.Sender.Text) = False Then msgbox("请输入正确内容") e.Cancel = TrueEnd If