gklux
asked on
VCL component : don't paint
Hi all,
I'm writing a component heriting from TStringGrid1.
This component have (with others things) a method that try to detect "bad" records, and select them. The problem is that when I set the Row Property (i.e. Self.Row=X), the TStringGrid allways set itself the Leftcol valut to the first non-fixed col. So I'm doing something like this :
...
I:=Self.LeftCol;
Self.Row:=X;
Self.LeftCol:=I
...
It works but if the user scoll down continuously, the component blinks because it have to paint with after row has changed, ang again once after leftcol is sets to I;
Question is : Just before the instruction "Self.Row:=X" how can I disable the drawing, and enable it juste after Self.leftcol:=I ?
regards
(hope it's clear... :-) )
Mike
I'm writing a component heriting from TStringGrid1.
This component have (with others things) a method that try to detect "bad" records, and select them. The problem is that when I set the Row Property (i.e. Self.Row=X), the TStringGrid allways set itself the Leftcol valut to the first non-fixed col. So I'm doing something like this :
...
I:=Self.LeftCol;
Self.Row:=X;
Self.LeftCol:=I
...
It works but if the user scoll down continuously, the component blinks because it have to paint with after row has changed, ang again once after leftcol is sets to I;
Question is : Just before the instruction "Self.Row:=X" how can I disable the drawing, and enable it juste after Self.leftcol:=I ?
regards
(hope it's clear... :-) )
Mike
I have seen this bug before.
My guess is:
LockWindowUpdate(Handle);
try
I:=Self.LeftCol;
Self.Row:=X;
Self.LeftCol:=I
finally
LockWindowUpdate(0);
end;
LockWindowUpdate locks the painting of the window of the specified handle.
Regards Jacco
My guess is:
LockWindowUpdate(Handle);
try
I:=Self.LeftCol;
Self.Row:=X;
Self.LeftCol:=I
finally
LockWindowUpdate(0);
end;
LockWindowUpdate locks the painting of the window of the specified handle.
Regards Jacco
Well it still flickers a bit....
Let me think...
Regards Jacco
Let me think...
Regards Jacco
I dont get it - i have added a comment to this question, but it's not here. And yet, i still getting mail notification about changes !!??!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Are you still here? Does this work for you?
Regards Jacco
Regards Jacco
Guess this question is abandoned...
Hello?
ASKER
Hi Jacco ! :-))
Really sorry, I was in holidays....
Based from your answers, il finnaly found an acceptable solution for my component. Thanks a lot.
regards
Mike
Really sorry, I was in holidays....
Based from your answers, il finnaly found an acceptable solution for my component. Thanks a lot.
regards
Mike
ASKER
thanks a lot, and sorry for the delay.
you can disable the refresh by rows and columns with this commands.
stringgrid1.rows.BeginUpda
stringgrid1.cols.BeginUpda
....
stringgrid1.cols.EndUpdate
stringgrid1.rows.EndUpdate
Hope this help,
BestRegards,
JSz.