最近学着写些东东,碰到疑难.
1、目的:在form上显示运行信息,
开始我用TMemo记录,显示正常,但不能改颜色,我改为TRichEdit,它每次运行完一次显示。
比如:for i:=1 to 4 do
       begin
           memo1.lines.add(inttostr(i));
           ......................
       end;
tmemo则一次一次显示
trichedit则等很久,全运行结束,一下全出来!!!
2、我用了多进程,一旦运行只能等到运行结束。有没有办法提前结束?

解决方案 »

  1.   

    memo1.lines.add(inttostr(i));
    memo1.Update;// 加上这一句,及时更新
      

  2.   

    memo1.lines.add(inttostr(i));
    此处由线程来处理
      

  3.   

    1 加入一行后,Application.ProcessMessages;
    2 应该是多线程吧
      在线程中检查他的Tenemented属性,True时结束
      在主程序中调用Thread.Tenemente;
      

  4.   

    比如
    procedure button1.click()
    for i;=1 to 4 do
    begin
      连数据库(调用别的进程)
      显示
    end;
    procedure button2.click()
    begin
    application.terminate;
    end
    数据库服务没开,连不上,第一次执行完,我看到信息,去点button2,点不起来!!!另:trichedit怎么能出来滚动条??谢谢啦!!!
      

  5.   

    procedure button1.click()
    for i;=1 to 4 do
    begin
      连数据库(调用别的进程)
      显示
      刷新
      Application.ProcessMessages;
    end;
    procedure button2.click()
    begin
    application.terminate;
    end设置trichedit的HideScrollBars为false
      

  6.   

    改成这样怎么样?
    procedure button1.click()
    var
      i: Integer;
    begin
      i := 0;
      while true do
      begin
        连数据库(调用别的进程)
        显示
        if (i = 4) or (提问<>重试) then application.terminate;
      end;
    end;
      

  7.   

    谢谢fancier(OP&&(C/C++)) 和 xiaocha(小查) 
    设置trichedit的HideScrollBars为false不管用呀!滚动条还是没有!
    我在线的,这个搞定就结帖!
    trichedit有没有字数限制??
      

  8.   

    对了,还要设置RichEdit1的ScrollBars属性。//trichedit有没有字数限制??
    你可以设置其MaxLength试试,如
    MaxLength:= 10;
      

  9.   

    //trichedit有没有字数限制??
    你可以设置其MaxLength试试,如
    MaxLength:= 10;上面好像不行。:(