关于TListBox的奇怪问题 我修改了ListBox的字号,设为了12号,默认是8号,可是第一行永远是8号字体,而后面的是变成了12号,请问高手,这是啥原因?怎么解决? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 listbox的style属性是什么?是不是设成lbOwnerDrawVariable了,而且在listbox的OnDrawItem事件里写什么代码了? 没有是,style是lbStandard,没有去重绘呀,我倒想将它重绘了,可是不知道改怎么做 重新放一個LISTBOX到窗體試下看會不會這樣。本身LISTBOX裏面的列都是靠 TStringList 去維護的,沒理由在非自繪的情況下不同的。 procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);begin if state = [odSelected,odFocused ]then begin ListBox1.Canvas.Brush.Color := clBlue; ListBox1.Canvas.FillRect(Rect); ListBox1.Canvas.Font.Size := 10; ListBox1.Canvas.Font.Color := clBlack; ListBox1.Canvas.TextOut(rect.Left,rect.Top,ListBox1.Items[Index]); end else begin ListBox1.Canvas.Brush.Color := clWhite; ListBox1.Canvas.FillRect(Rect); ListBox1.Canvas.Font.Size := 10; ListBox1.Canvas.TextOut(rect.Left,rect.Top,ListBox1.Items[Index]); end;end; 隨便寫了自繪的代碼,根據需要你再改改。 STYLE 設為: lbOwnerDrawVariable 从新安装系统后,quickreport预览和打印出来的字形变了? 各位高手,如何用代码打开DateTimePicker 控件的日期选择 急,,在线等 一个问题??? 如何使用DELPHI对考勤机的进行数据的操作 50分求教,怎实现按下Enter,控件的焦点下移啊?! 够菜问题,当场结贴 用Delphi做PDA的后台,大概用什么样的技术 请问关于Set of 的问题??菜鸟请教! 怎么用继承的方法?除了继承还有什么方法可重复使用窗体? MDI子窗口的问题 各位老师好; 原来做好的数据库连接现在有问题了... Delphi如何做曲线图
Rect: TRect; State: TOwnerDrawState);
begin
if state = [odSelected,odFocused ]then
begin
ListBox1.Canvas.Brush.Color := clBlue;
ListBox1.Canvas.FillRect(Rect);
ListBox1.Canvas.Font.Size := 10;
ListBox1.Canvas.Font.Color := clBlack;
ListBox1.Canvas.TextOut(rect.Left,rect.Top,ListBox1.Items[Index]);
end else begin
ListBox1.Canvas.Brush.Color := clWhite;
ListBox1.Canvas.FillRect(Rect);
ListBox1.Canvas.Font.Size := 10;
ListBox1.Canvas.TextOut(rect.Left,rect.Top,ListBox1.Items[Index]);
end;end; 隨便寫了自繪的代碼,根據需要你再改改。 STYLE 設為: lbOwnerDrawVariable