我想可能要重写TstringGrid类的某个画图的方法吧...
解决方案 »
- 如何编写一个播放器可以添加播放清单的?
- interbase如何导入到access
- 有个EXCEL文件带有密码123(自己设置,为了EXCEL文件保密),请问如何用DELPHI代码打开该文件?请高手指点
- dbgrideh 怎样设置才使其实现某列的自动统计功能
- richedit保存成文件(RTF)的时候什么不能把文本的格式保存下来啊,如我的字体颜色是红的,
- 如何判断ADOStoredProc已经执行完?
- 给点建议吧……
- 为何我的Adoquery增加记录有时会出现"Grid index out of range"?何解?
- 在StringGrid中实现类似Combox的选择功能?
- 请问,Memo控件和Richedit控件的区别?
- 高分请教:MDI窗口的背景图片的拉伸功能
- 怎样用Delphi实现snmp协议???
StringGrid1->FixedRows = 0;
不行啊,把我的标题拦搞没了
StringGrid1.FixedCols := 0;
StringGrid1.FixedColor := clWindow;
StringGrid1.Col:=1;
StringGrid1.Row:=1;
StringGrid1.SetFocus;
就可以了
在ListView的OnDrawCell事件里写代码。下面的是C++Builder的写法。//----------------------------------------------------------------__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
TGridRect Rect;
Rect.Left = -1;
Rect.Top = -1;
Rect.Right = -1;
Rect.Bottom = -1;
StringGrid1->Selection = Rect;
}void __fastcall TForm1::StringGrid1DrawCell(TObject *Sender,
int ACol, int ARow, TRect &Rect, TGridDrawState State)
{
if (State.Contains(gdSelected)) {
StringGrid1->Canvas->Rectangle(Rect);
这儿输出文本的具体位置,你可以查一下Source
StringGrid1->Canvas->TextOut(Rect.left+2,
Rect.top+2, StringGrid1->Cells[ACol][ARow]);
}
}