我设了一个main窗口和next窗口,在main窗口中有一个button,我想在点button时弹出next窗口,就这么简单!可是老是出错显示
“[Pascal Error] Main.pas(1): Unable to invoke Code Completion due to errors in source code”我觉得我做的没错的。我先在main中的做了这下:implementationuses next;{$r *.dfm}然后:procedure TMainForm.Button1Click(Sender: TObject);
begin
next.form1.Show;
end;然后编译时就显示出:
  [Error] Main.pas(29): Record, object or class type required
  [Fatal Error] Pro_test.DPR(5): Could not compile used unit 'Main.pas'我是个初学者,照着书上说的都会出错。真是奇怪了。请大家帮帮我,谢谢.

解决方案 »

  1.   

    在没编译里我在:procedure TMainForm.Button1Click(Sender: TObject);
    begin
    next.
    end;打到“.”号时就会出现:“[Pascal Error] Main.pas(1): Unable to invoke Code Completion due to errors in source code”的提示错误.
      

  2.   

    第一个:u_main.pas    frm_main 
    第二个:u_next.pas    frm_next
    implementation
    uses u_next;
    {$r *.dfm}
    procedure TMainForm.Button1Click(Sender: TObject);
    begin
    frm_next.Show;
    end;
    这样就可以了
      

  3.   

    xinshiji(自由我有) ( ) 信誉:100
      

  4.   

    我按xinshiji朋友说的做了:
    procedure TMainForm.Button1Click(Sender: TObject);
    begin
    form1.Show;
    end;
    可以编译出来,可是在点Button1时,出现了如下错误:
    'Access violation at address 00467F5E in module 'next.ext'. Read of address 000002F4'.
    怎么会这样呀。
      

  5.   

    这个提示应该是你的NEXT窗口没创建的原因
      

  6.   

    你的next窗體有沒有創建呀?可以改成如下:
    if not Assigned(Next) then
    begin
      創建
    end;Next.Show;另外還需要在Next的OnDestory事件中加上:
    Next := nil;
    ----------------------------------------
    想問一句題外話:樓主是用來做什麼的?
    如果是用來做類似安裝程序的話,我覺得用
    TPageControl,然後在每一個窗體用一個TabSheet
    來代替,即可