Z zqs10597249 Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-25 #2 combobox1.Items.IndexOf(str)=-1<br>看str有没存在<br>这样不好吗?
A aa9 Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-26 #3 这样当然可以但我想知道<br> sendmessage(combobox1.handle,lb_findstring,0,'aa');<br> //aa是我想找的string<br> //照win32sdk中的意思 lb_findstring的lParam是不为空的string<br> //但运行说 最后一个参数类型错误,我想知道究竞错在哪而已
这样当然可以但我想知道<br> sendmessage(combobox1.handle,lb_findstring,0,'aa');<br> //aa是我想找的string<br> //照win32sdk中的意思 lb_findstring的lParam是不为空的string<br> //但运行说 最后一个参数类型错误,我想知道究竞错在哪而已
刘 刘李子 Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-26 #4 if sendmessage( combobox1.handle, cb_findstring, -1, lparam( lpcstr('aaa') )   = CB_ERR then<br> showmessage('specified string not found !');<br>最后一个参数为指向字符串的地址 !<br>
if sendmessage( combobox1.handle, cb_findstring, -1, lparam( lpcstr('aaa') )   = CB_ERR then<br> showmessage('specified string not found !');<br>最后一个参数为指向字符串的地址 !<br>
Z zqs10597249 Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-26 #5 to aa9:<br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br>str:string;<br>num:integer;<br>begin<br>str:=edit1.Text;<br>num:=sendmessage( combobox1.handle, cb_findstring, -1,Cardinal(str));<br>edit2.text:=inttostr(num);<br>if num=-1 then<br>begin<br>showmessage('没找到!');<br>end;<br>end;<br>可以给分了吧!
to aa9:<br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br>str:string;<br>num:integer;<br>begin<br>str:=edit1.Text;<br>num:=sendmessage( combobox1.handle, cb_findstring, -1,Cardinal(str));<br>edit2.text:=inttostr(num);<br>if num=-1 then<br>begin<br>showmessage('没找到!');<br>end;<br>end;<br>可以给分了吧!