I have my own Form Resize function, but i have problem with TChromium component. When I'm trying to resize Form, TChromium's background color changing to black and blinking fast until resize process stops, instead of it must be white everytime. This bug works only in DelphiXE3. In Delphi7 all fine, but i can't use Delphi7 for some reason(Some TChromium Functions Not Works).
Help me fix this problem, please. Here is my Resize Function code, based on Timer Component(Interval:1):
//-------------------------FORM RESIZE TIMER BEGIN
if(Form1.Width>=((Screen.Width div 2))) then
begin
if(resize_to=LEF) then
begin
//Lets Resize To Left
if((Form1.Width>((Screen.Width div 2))) OR ((Mouse.CursorPos.X-Last_Cur_POSx)<0)) then
Form1.Left:=Mouse.CursorPos.X;
if((Form1.Width>((Screen.Width div 2))) OR ((Mouse.CursorPos.X-Last_Cur_POSx)<0)) then
Form1.Width:=Form1.Width-(Mouse.CursorPos.X-Last_Cur_POSx);
SetCursorPos(Form1.Left,Mouse.CursorPos.Y);
Last_Cur_POSx:=Mouse.CursorPos.X; //Remember Last Cursor Position
end
else
if(resize_to=RIGHT) then
begin
//Lets Resize To Right
if((Form1.Width>((Screen.Width div 2))) OR ((Mouse.CursorPos.X-Last_Cur_POSx)>0)) then
Form1.Width:=Form1.Width+(Mouse.CursorPos.X-Last_Cur_POSx);
SetCursorPos(Form1.Left+Form1.Width,Mouse.CursorPos.Y);
Last_Cur_POSx:=Mouse.CursorPos.X; //Remember Last Cursor Position
end
else
if(resize_to=BOTTOM) then
begin
//Lets Resize To Bottom
if(Form1.Height<(Screen.Height div 2)) then
Form1.Height:=Screen.Height div 2
else
if((Form1.Height-Form1.Top)<=((Screen.Height-Task_Panel_Size)-Form1.Top)) then
Form1.Height:=Form1.Height+(Mouse.CursorPos.Y-Last_Cur_POSy)
else
Form1.Height:=((Screen.Height-Task_Panel_Size)-Form1.Top);
SetCursorPos(Mouse.CursorPos.X,Form1.Top+Form1.Height);
Last_Cur_POSy:=Mouse.CursorPos.Y; //Remember Last Cursor Position
end
end
else
begin
Form1.Width:=(Screen.Width div 2);
end
//-------------------------FORM RESIZE TIMER END
Thanks.
The problem is solved, by adding sleep(100); command in Form1.Paint event :)The problem solved, by removing all handmade resize functions, and activating Form default resizers.
Thanks to everybody for helping