- 时间:2022-03-18 08:44 编辑: 来源: 阅读:
- 扫一扫,手机访问
摘要:oracle 动态AdvStringGrid完美示例 (AdvStringGrid使用技巧/Cells)
原理就是先声明常量,包括列数,行数,各列的属性,然后在程序的其它过程用这些常量来控制Cells。非常方便,便于修改和移植!
以下为窗体整体代码,中间有说明。此段代码不光有动态AdvStringGrid的完美示例,还有一般窗体的常用的过程,比较窗体初始化,刷新过程。
此窗体,只需要简单准备如下,即可运行:
1,添加一个TAdvStringGrid,并命名为strGrid1。
2,设置:TAdvStringGrid-->option-->goEditing=true
TAdvStringGrid-->enableGraphics=true
3,修改Form名称为form1,或替换以下代码中的form1为当前窗体的名字。
4,将以下代码覆盖原来的代码。
5,关联以下过程(只需要在窗体和strGrid1控件属性-事件页中双击相关项即可完成关联。)
FormCreate
FormShow
strGrid1CanEditCell
strGrid1GetAlignment
strGrid1GetCellColor
strGrid1GetEditorType
[url=http://xiazai.jb51.net/200906/other/DynamicCells_Setting.xls]http://xiazai.jb51.net/200906/other/DynamicCells_Setting.xls[/url]