怎样给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; IdTCPserver控件 监听端口 RichviewEdit如何才能显示带有格式的文字? 数据库查询问题 查询问题 汉语拼音问题,高分求解。急急急,在线等!~! 请问如何实现翻页查询 急,如何得到在image中看到数据库中的图象 请问什么是“大屏幕系统”?及在Delphi中实现的提示? 用READ和WRITE可以对文本中的内容进行读写,怎么才能删除文本中指定的行呢? 请教如何定义一个应用级的全局变量,使一个应用程序的各个模块均能存取该变量 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;