Hi,
I'm trying to limit my worksheet (grid) to 15 columns, so set the value ColCount to 15.
However, if I move the cell right it just adds more columns.
I've tried adding a keydown handler to check if its the right arrow key and if the current cell is less that ColCount then add one to col and zero the key, but this doesn't work, it still just adds columns. If I monitor the col value and the colCount values, the ColCount value increase when the col value is (at least) 2 less that the ColCound value.
Am I missing something here?
[Edit: I found that I should be using Get Last ColIndex rather than ColCount, but still I'm trapping the cursor move rather than limiting the grid size]
Thanks Dave
Case Key of
VK_Right, VK_Tab:
begin
showmessage (wsg3Year.col.ToString + '....' + wsg3Year.ColCount.ToString);
if wsg3Year.Col < wsg3Year.colCount then
wsg3Year.Col := wsg3Year.Col + 1;
Key := 0;
end;
...
...
...
end;