D
delhpi
Unregistered / Unconfirmed
GUEST, unregistred user!
我写的过程实现不了这个效果?<br>请教大家,应该如何写,放在组合框什么事件中?<br><br>procedure AddCmbHScroolBar(combo:TcomboBox);<br>var<br>i,maxwidth:integer;<br><br>begin<br>if combo.items.count=0 then exit;<br>maxwidth := 0;<br><br>for i:=0 to combo.items.count-1 do<br> if maxwidth < combo.canvas.textwidth(combo.items.Strings) then<br> maxwidth := combo.Canvas.textwidth(combo.items.strings);<br><br> sendmessage(combo.handle,CB_SETHORIZONTALEXTENT, maxwidth+2,0);<br>end;