procedure TSubSet1.ModifyClick(Sender: TObject);
var
  modila:TFME1; 
begin
  modila:=TFME1.Create(self);
  with modila do
  begin
    MTime.Text:= StrGrid.Cells[0,StrGrid.Row];//可执行
    Grad.Text:= StrGrid.Cells[1,StrGrid.Row];//执行
    if ShowModal <> idCancel then  //当我单独运行本procedure时,该处不能执行
    begin
        StrGrid.Cells[0,StrGrid.Row]:=modila.MTime.Text;
        StrGrid.Cells[1,StrGrid.Row]:=modila.Grad.Text;  
    end;
  end;
end;
另有一小问:我怎么能让maskedit(时间显示,如12:00)很好的显示来自edit数字(如1200)成为时间(如12:00),我的显示只能是edit得后两位在maskedit前两位显示,我小艾初学,望各位大虾指点

解决方案 »

  1.   

    补充一下,我用的是delhpi7,并在uses中添加了所要调用的单元,我想问题应该出在showmodal处, 唉,求助
      

  2.   

    这个程序不能执行是否是因为在TFMEl的创建事件或Show事件等中出现问题,建议你跟踪一下,你这样写的过程应该是没有问题的
      

  3.   

    第二个问题我觉得只好用
    str := rightstr(edit.text, 4);
    str := leftstr(str, 2) + ':' + rightstr(str, 2);
    maskedit.text = str;
    不过需要判断是否有输入错误。
    rightstr和leftstr在StrUtils中
      

  4.   

    先改成 if ShowModal = mrOk then  
    看看能不能执行
      

  5.   

    to:minjunw,我没有过strutils,怎么用,在那里添加,我查sdk也没找到它呀