Jump to content

Recommended Posts

Posted
hello everyone
There is a certain code that runs in a loop

 


    for i:=0 to MainForm.sdata.Count-1 do begin
      srow.DelimitedText:=MainForm.sdata[i];
      MainForm.qry.SQL.Clear;
      MainForm.qry.SQL.Text:=MainForm.GetQuery('ADD_GOODS');
      MainForm.qry.Parameters.ParamByName('name').Value:=srow.Strings[0];
      MainForm.qry.Parameters.ParamByName('coast').DataType:=ftFloat;
      MainForm.qry.Parameters.ParamByName('coast').Value:=StrToFloat(srow.Strings[1]);
      MainForm.qry.Parameters.ParamByName('barcode').Value:=srow.Strings[2];
      MainForm.qry.Parameters.ParamByName('orgid').Value:=MainForm.qCurrentClient;
      MainForm.qry.ExecSQL;


      prgLoad.Position:=i;
    end;

And there is a form on which the progress bar

So the problem is that this code does not update the progress bar.

 


      prgLoad.Refresh;
      frmLoading.Refresh;


      prgLoad.Repaint;
      Repaint;


      update;
      prgLoad.Update;

What could be the problem? Thank U

 

 

post-755-0-13631500-1425141912_thumb.png

Posted

This technique can be applied in uniGUI. Pls see one of ThreadTimer demos to see how run tasks in background.

Well and how can I access the object in the frame of the other forms of application?
Let's say I have a frame called frOneFrame (TfrOneFrame) unit in which it is located uOneFrame
 
Button1 object
 
I tried (frOneFrame as TfrOneFrame) .Button1.Enabled = true;
 
But I did not work :(

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...