0

我想在派生的 DBGrid 中设置派生 TInplaceEdit 中的插入符号位置,类似于右对齐列的 TDBGrid。

procedure TMyGridEditor.CreateParams(var Params: TCreateParams);
const
  Alignments : array[TAlignment] of LongWord= (ES_Left, ES_Right, ES_Center);
begin
  inherited CreateParams(Params);
  Params.Style := Params.Style or Alignments[FAlignment];
end;

procedure TMyGridEditor.UpdateContents;
begin
  inherited;
  // if Assigned(Grid) and Assigned(Grid.SelectedColumn) then begin
  //  Alignment := Grid.SelectedColumn.Alignment;
  if (TDBGrid(Grid).SelectedIndex <> -1) then 
    Alignment := TDBGrid(Grid).Columns[TDBGrid(Grid).SelectedIndex].Alignment;
end;

附加说明:

Grid.SelectedColumn = 当前选择的网格列

示例图片:列太小,价值不高

问题 1:插入符号的位置总是在右边并且位于最后一个字符之后,这对于 ie 来说看起来很奇怪。字符串和备忘录内容。如何在显示 inplaceeditor 之后将插入符号设置在左侧。

问题 2:当没有足够的可用空间时(列太小),数值的内容显示在多行上。这看起来很奇怪。

我怎样才能完成这些任务?任何帮助表示赞赏...谢谢

4

0 回答 0