我有這種問題。我試圖改變我的主要形式。我創建了新項目並刪除了主窗體,之後我使用Project - > Add to project將窗體添加到了項目中。之後它會自動更改項目設置,並使用添加的表單。但是,如果我運行這個應用程序,它顯示空表單,即使它不是我添加到項目中的空表單。德爾福改變主要形式
program LimitMac;
uses
FMX.Forms,
MacLimiter in 'MacLimiter.pas' {FormLimiter};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TFormLimiter, FormLimiter);
Application.Run;
end.
和MacLimiter(TFormLimiter)是我添加到項目中的舊形式,但它顯示空格式。
而且MacLimiter單元,這是MacLimiter單元的一部分,它表明,它是不是空的形式:
unit MacLimiter;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls,
FMX.Edit, FMX.Layouts, FMX.ListBox;
type
TFormLimiter = class(TForm)
StyleBook1: TStyleBook;
Brush1: TBrushObject;
Label1: TLabel;
Label2: TLabel;
EditTunnus: TEdit;
EditSalasana: TEdit;
ImageControl1: TImageControl;
ImageControl2: TImageControl;
ListBox1: TListBox;
Label3: TLabel;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
RadioButton5: TRadioButton;
RadioButton6: TRadioButton;
RadioButton7: TRadioButton;
RadioButton8: TRadioButton;
RadioButton9: TRadioButton;
ProgressBar1: TProgressBar;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label9: TLabel;
Label10: TLabel;
Button1: TButton;
Button2: TButton;
Button3: TButton;
ListBox2: TListBox;
RadioButton4: TRadioButton;
RadioButton10: TRadioButton;
Label8: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure EditSalasanaTyping(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure RadioButton1Change(Sender: TObject);
procedure RadioButton2Change(Sender: TObject);
procedure RadioButton3Change(Sender: TObject);
procedure RadioButton9Change(Sender: TObject);
procedure RadioButton5Change(Sender: TObject);
procedure RadioButton6Change(Sender: TObject);
procedure RadioButton7Change(Sender: TObject);
procedure RadioButton8Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormLimiter: TFormLimiter;
var Index: Integer;
implementation
{$R *.fmx}
procedure TFormLimiter.Button1Click(Sender: TObject);
begin
Application.Terminate;
end;
procedure TFormLimiter.Button3Click(Sender: TObject);
var i: Integer;
begin
ProgressBar1.Value := 0;
ProgressBar1.Max := 100;
Button1.Enabled := false;
for i := 0 to 100 do
begin
ProgressBar1.Value := i;
Sleep(200);
Application.ProcessMessages;
end;
Label9.Visible := true;
Label10.Visible := true;
Button3.Visible := true;
end;
procedure TFormLimiter.EditSalasanaTyping(Sender: TObject);
begin
if(EditTunnus.Text <> '') then begin
if(index > 0) then begin
Button2.Enabled := true;
end;
end;
end;
procedure TFormLimiter.FormShow(Sender: TObject);
begin
index := 0;
end;
procedure TFormLimiter.RadioButton1Change(Sender: TObject);
begin
index := 1;
if(EditTunnus.Text <> '') then begin
if(EditSalasana.Text <> '') then begin
Button2.Enabled := true;
end;
end;
end;
procedure TFormLimiter.RadioButton2Change(Sender: TObject);
begin
index := 2;
if(EditTunnus.Text <> '') then begin
if(EditSalasana.Text <> '') then begin
Button2.Enabled := true;
end;
end;
end;
procedure TFormLimiter.RadioButton3Change(Sender: TObject);
begin
index := 3;
if(EditTunnus.Text <> '') then begin
if(EditSalasana.Text <> '') then begin
Button2.Enabled := true;
end;
end;
end;
procedure TFormLimiter.RadioButton5Change(Sender: TObject);
begin
index := 5;
if(EditTunnus.Text <> '') then begin
if(EditSalasana.Text <> '') then begin
Button2.Enabled := true;
end;
end;
end;
procedure TFormLimiter.RadioButton6Change(Sender: TObject);
begin
index := 6;
if(EditTunnus.Text <> '') then begin
if(EditSalasana.Text <> '') then begin
Button2.Enabled := true;
end;
end;
end;
procedure TFormLimiter.RadioButton7Change(Sender: TObject);
begin
index := 7;
if(EditTunnus.Text <> '') then begin
if(EditSalasana.Text <> '') then begin
Button2.Enabled := true;
end;
end;
end;
procedure TFormLimiter.RadioButton8Change(Sender: TObject);
begin
index := 8;
if(EditTunnus.Text <> '') then begin
if(EditSalasana.Text <> '') then begin
Button2.Enabled := true;
end;
end;
end;
procedure TFormLimiter.RadioButton9Change(Sender: TObject);
begin
index := 9;
if(EditTunnus.Text <> '') then begin
if(EditSalasana.Text <> '') then begin
Button2.Enabled := true;
end;
end;
end;
end.
請顯示驗證碼。特別是在.dpr文件中。 –
現在有部分MacLimiter代碼和項目文件代碼 – user3621674
.dfm文件是否有效? –