在一个工程中form1不见了。就是比如想调整button控件的位置,没法调。但是编译运行时候正常,form就出来了。请问怎么把form调出来,谢谢。

解决方案 »

  1.   

    是在TEXT方式下。但是右键点看view as form是灰的。
      

  2.   

    alt+f12也不行啊。后又试了ctrl+f12和shift+f12点出form,但出来的还是代码。出不来form那种图形界面。
      

  3.   


    出来Form代码后 按 F12 就可以啦
      

  4.   

    猜测可能是窗体被移到桌面之外了,你可以在Form代码中按f12,然后按f11,看窗体的left和top属性
    也可以在Form代码中按f12切到窗体界面后,按alt+space,把窗体移动回来
      

  5.   

    这个不行,就重新建一个form,然后把代码考进来就行了。
      

  6.   

    你好,在工程中按f12可以切換form與程式碼的畫面,或是新增一個form即可,謝謝。
      

  7.   

    打开工程(.dpr)文件:untFrmMain in 'untFrmMain.pas' {frmTCPSvr},    //就是这一句导致的缺少了红色部分,Form就不见了。
      

  8.   

    我是楼主,谢谢各位了。但是好像说的方法还是不行。
    这个程序是根据输入的数据,进行一些计算,最后输出结果。FORM是我建的,上面有很多LABEL和EDIT组件,所以删了再重建挺麻烦的。然后应该不是F12或者F11的问题,因为对象查看器是灰的,根本看不到FORM的属性,但是可以看FORM的代码,而右键点form的代码部分,想看view as form,可也是灰的。
    form之前出现过,因为是我建的。但是后来就不见了。有一位提出了untFrmMain in 'untFrmMain.pas' {frmTCPSvr},    加上括号里的。可是我程序没有untFrmMain in 'untFrmMain.pas' 这句话。
    我在群里之前关于这个程序还问了个问题,是不是跟那个有关系。就是我当时在implementation
      {$R  *.DFM}语句中,把括号部分删掉了,导致了运行时候出错。我当时不知道是什么原因,经过解答才知道我是误删了{$R  *.DFM}部分,加上就好了。然后运行就正常了。可能是这之后再进工程就看不见form了,只能看到其代码形式。现在的情况是否和加上{$R  *.DFM}有关,我感觉应该没有关系。具体是什么情况。请各位帮忙,谢谢了!
    下面附上代码,因为是自学而且是初学,只好来论坛请教~
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Label101: TLabel;
        Label102: TLabel;
        Label103: TLabel;
        Button1: TButton;
        Label104: TLabel;
        Label105: TLabel;
        Label106: TLabel;
        Label107: TLabel;
        Label108: TLabel;
        Label109: TLabel;
        Label120: TLabel;
        Label125: TLabel;
        Label124: TLabel;
        Label123: TLabel;
        Label122: TLabel;
        Label121: TLabel;
        Edit1a: TEdit;
        Edit1b: TEdit;
        Edit1c: TEdit;
        Edit2a: TEdit;
        Edit9c: TEdit;
        Edit8c: TEdit;
        Edit7c: TEdit;
        Edit6c: TEdit;
        Edit5c: TEdit;
        Edit4c: TEdit;
        Edit3c: TEdit;
        Edit2c: TEdit;
        Edit12a: TEdit;
        Edit11a: TEdit;
        Edit10a: TEdit;
        Edit9a: TEdit;
        Edit8a: TEdit;
        Edit7a: TEdit;
        Edit6a: TEdit;
        Edit5a: TEdit;
        Edit4a: TEdit;
        Edit3a: TEdit;
        Edit7b: TEdit;
        Edit6b: TEdit;
        Edit5b: TEdit;
        Edit2b: TEdit;
        Edit4b: TEdit;
        Edit3b: TEdit;
        Edit12b: TEdit;
        Edit12c: TEdit;
        Edit11c: TEdit;
        Edit10c: TEdit;
        Edit11b: TEdit;
        Edit10b: TEdit;
        Edit9b: TEdit;
        Edit8b: TEdit;
        Label1: TLabel;
        Label2: TLabel;
        Label3: TLabel;
        Label7: TLabel;
        Label5: TLabel;
        Label6: TLabel;
        Label4: TLabel;
        Label12: TLabel;
        Label11: TLabel;
        Label10: TLabel;
        Label9: TLabel;
        Label8: TLabel;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;
      arrayThing:array[1..12] of single;
      arrayNightwork:array[1..12] of single;
      arrayWeekendwork:array[1..12] of single;
      arrayResult:array[0..12] of single;
      arrayout:array[1..12] of single;
      monthflag:integer;
      flag:integer;
      i:integer;implementation
      {$R  *.DFM}procedure TForm1.Button1Click(Sender: TObject);
    begin
      arrayThing[1]:=strtofloat(edit1a.text);
      arrayNightwork[1]:=strtofloat(edit1b.text);
      arrayWeekendwork[1]:=strtofloat(edit1c.text);
      arrayThing[2]:=strtofloat(edit2a.text);
      arrayNightwork[2]:=strtofloat(edit2b.text);
      arrayWeekendwork[2]:=strtofloat(edit2c.text);
      arrayThing[3]:=strtofloat(edit3a.text);
      arrayNightwork[3]:=strtofloat(edit3b.text);
      arrayWeekendwork[3]:=strtofloat(edit3c.text);
      arrayThing[4]:=strtofloat(edit4a.text);
      arrayNightwork[4]:=strtofloat(edit4b.text);
      arrayWeekendwork[4]:=strtofloat(edit4c.text);
      arrayThing[5]:=strtofloat(edit5a.text);
      arrayNightwork[5]:=strtofloat(edit5b.text);
      arrayWeekendwork[5]:=strtofloat(edit5c.text);
      arrayThing[6]:=strtofloat(edit6a.text);
      arrayNightwork[6]:=strtofloat(edit6b.text);
      arrayWeekendwork[6]:=strtofloat(edit6c.text);
      arrayThing[7]:=strtofloat(edit7a.text);
      arrayNightwork[7]:=strtofloat(edit7b.text);
      arrayWeekendwork[7]:=strtofloat(edit7c.text);
      arrayThing[8]:=strtofloat(edit8a.text);
      arrayNightwork[8]:=strtofloat(edit8b.text);
      arrayWeekendwork[8]:=strtofloat(edit8c.text);
      arrayThing[9]:=strtofloat(edit9a.text);
      arrayNightwork[9]:=strtofloat(edit9b.text);
      arrayWeekendwork[9]:=strtofloat(edit9c.text);
      arrayThing[10]:=strtofloat(edit10a.text);
      arrayNightwork[10]:=strtofloat(edit10b.text);
      arrayWeekendwork[10]:=strtofloat(edit10c.text);
      arrayThing[11]:=strtofloat(edit11a.text);
      arrayNightwork[11]:=strtofloat(edit11b.text);
      arrayWeekendwork[11]:=strtofloat(edit11c.text);
      arrayThing[12]:=strtofloat(edit12a.text);
      arrayNightwork[12]:=strtofloat(edit12b.text);
      arrayWeekendwork[12]:=strtofloat(edit12c.text);
      flag:=1;
      arrayresult[0]:=0;
      i:=0;
      for monthflag:=1 to 12 do
      begin
        if i>=3 then
        begin
          i:=0;
          arrayresult[flag-1]:=0;
        end;
        arrayresult[flag]:=arrayresult[flag-1]
                          +arraything[flag]
                          -arrayweekendwork[flag];
        if  arrayresult[flag]>0 then
            arrayresult[flag]:=arrayresult[flag]-arrayNightwork[flag];
        if  arrayresult[flag]<0 then
          i:=i+1
          else
          i:=0;
        arrayout[flag]:=arrayresult[flag];
        flag:=flag+1;
      end;
      label1.Caption:=floattostr(arrayout[1]);
      label2.Caption:=floattostr(arrayout[2]);
      label3.Caption:=floattostr(arrayout[3]);
      label4.Caption:=floattostr(arrayout[4]);
      label5.Caption:=floattostr(arrayout[5]);
      label6.Caption:=floattostr(arrayout[6]);
      label7.Caption:=floattostr(arrayout[7]);
      label8.Caption:=floattostr(arrayout[8]);
      label9.Caption:=floattostr(arrayout[9]);
      label10.Caption:=floattostr(arrayout[10]);
      label11.Caption:=floattostr(arrayout[11]);
      label12.Caption:=floattostr(arrayout[12]);
    end;end.
    这个程序运行已经没有问题了,现在就是看不见form.只能看见代码形式。比如想要加个label就不能加。