在程序中实现为去掉dgColumnResize~~DBGrid1.Option := (dgEditing, dgAlwaysShowEditor, dgTitles, dgIndicator, dgColLines, dgRowLines, dgTabs, dgRowSelect, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit, dgMultiSelect);
解决方案 »
- [分享]移动窗体的小例子
- 怎样写带参数的虚拟函数
- delphi中调用vb里的winsock控件该怎么做呀?能说明具体点嘛?谢谢!
- 用query1连DBLookupCombo时,DBLookupCombo我只设置了listsource,为DataSource2,DataSource2与query1相连
- 做过ispai filter 的高手进来一下
- 请问如何给DBGrid加上CheckBox?
- 为什么会出现这样的错误?(时间问题)
- 关于ACESS与BDEL设置问题
- 究竟“标记没有引用存储”是什么错误?
- 一个高分的DELPHI问题!(HOT)
- 这个事务怎么实现?
- 为什么报表中的某些线(qrshape),在激光打印机中打印不出来,而在喷墨打印机中确正常???
TDBGridOption = (dgEditing, dgAlwaysShowEditor, dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgRowSelect, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit, dgMultiSelect);TDBGridOptions = set of TDBGridOption;property Options: TDBGridOptions;DescriptionSet Options to include the desired properties for the data-aware grid. Options is a set drawn from the following values:Value MeaningdgEditing The user can edit data using the grid. dgEditing is ignored if Options includes dgRowSelect.
dgAlwaysShowEditor The grid is always in edit mode. That is, the user does not have to press Enter or F2 before editing the contents of a cell. dgAlwaysShowEditor does nothing unless dgEditing is also included in Options. dgAlwaysShowEditor is ignored if Options includes dgRowSelect.
dgTitles Titles appear at the top of the columns in the grid.
dgIndicator A small pointer appears in the first column to indicate which row is current.dgColumnResize Columns that are bound to fields can be resized or moved.
dgColLins Lines appear between columns in the grid.
dgRowLines Lines appear between the rows of the grid.
dgTabs The user can navigate through the grid using the Tab and Shift+Tab keys.
dgRowSelect The user can select an entire row, as well as selecting individual cells. If Options includes dgRowSelect, dgEditing and dgAlwaysShowEditor are ignored.
dgAlwaysShowSelection The selected cell displays the focus rectangle even when the grid does not have focus.dgConfirmDelete A message box appears, asking for confirmation, when the user types Ctrl+Delete to delete a row in the grid.
dgCancelOnExit When the user exits the grid from an inserted record to which the user made no modifications, the inserted record is not posted to the dataset. This prevents the inadvertent posting of empty records.
dgMultiSelect More than one row in the grid can be selected at a time.
同意“一两狂死郎之天衣有缝”
但是同时dbgrid的列宽度也不让调整,可以用以下语句:
tStringGrid(DbGrid1).Options:=tStringGrid(DbGrid1).Options-[goColMoving];
好像没有这种允许改变列的大小又禁止列的拖动的属性
又学一招