ComboBox1 里选择的内容不等于指定的内容时提示出错,代码该怎么写?
例如ComboBox1 里选择的内容不等于 '天' '空' '孔' '是' '洒' '我' 这些内容时就提示出错信息,代码该怎么写?
[解决办法]
!-_-
我那两种方式都可以解决你的问题。
[解决办法]
function ishe(s:string):boolean;
begin
result:=false;
if (s='天')or(s='空')or(s='孔')or(s='是')or(s='洒')or(s='我') then
result:=true;
end;
这个函数可以解决你的问题:例如
if not ishe(combobox1.text) then
showmessage('error');