怎样给list的每一行加个小图片?可以上下滚动? 什么LIST,如果是LISTBOX的话,先设为自画风格,然后在绘画事件里自己把图片画上去. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 先设置成自绘,然后在List的OnDrawItem里自己画。 对,先自画!procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);var Rect1: TRect; Rect2: TRect;begin Inc(Rect.Bottom,16); Rect1.Left := Rect.Left; Rect1.Bottom := Rect.Bottom ; Rect1.Right := Rect1.Left +32; Rect1.Top := Rect.Top; Rect2.Left := 0; Rect2.Right :=32; Rect2.Top := 0; Rect2.Bottom := 32; TCombobox(Control).Canvas.CopyRect(Rect1,image1.Canvas,Rect2);end;procedure TForm1.ComboBox1MeasureItem(Control: TWinControl; Index: Integer; var Height: Integer);begin Height := 32;end; 将style设置成 csownerdrawvariable 后在OnDrawItem中画,procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);begin with ComboBox1 do begin Canvas.FillRect(Rect); ImageList1.Draw(Canvas, Rect.Left, Rect.Top + 2, Index); Canvas.TextOut(Rect.Left + 20, Rect.Top + 2, Items[Index]); end;end; CSDN太坑爹了 下面是冯哥给的根据CPU资源利用率报警的程序,虽然是完整代码了,可是小弟实在惭愧,还是有点看不明白,请懂行的朋友帮忙分析一下,如何 dll动态调用出错了 请问大家做销售界面的一般什么网格控件 我想用TMSChart这个控件,到哪里去下载? 请问:DBGrideh的SumList可以支持主从查询吗 怎么把数据游标指到表中的第N条纪录! ADOQuery的插入问题,急!! 新闻组的问题 请问如何用sql语句查询一段日期之内的数据? SendMessage发送消息的一点问题! 关于ADODataSet的问题,请大家帮忙解决!谢谢
procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);var Rect1: TRect; Rect2: TRect;begin Inc(Rect.Bottom,16); Rect1.Left := Rect.Left; Rect1.Bottom := Rect.Bottom ; Rect1.Right := Rect1.Left +32; Rect1.Top := Rect.Top; Rect2.Left := 0; Rect2.Right :=32; Rect2.Top := 0; Rect2.Bottom := 32; TCombobox(Control).Canvas.CopyRect(Rect1,image1.Canvas,Rect2);end;procedure TForm1.ComboBox1MeasureItem(Control: TWinControl; Index: Integer; var Height: Integer);begin Height := 32;end;
后在OnDrawItem中画,procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);begin with ComboBox1 do begin Canvas.FillRect(Rect); ImageList1.Draw(Canvas, Rect.Left, Rect.Top + 2, Index); Canvas.TextOut(Rect.Left + 20, Rect.Top + 2, Items[Index]); end;end;