ورود

View Full Version : ایجاد فرم



joooje
سه شنبه 20 دی 1390, 19:53 عصر
چطور میشه توی دلفی پرسیم یه فرم به برنامه اضافه کرد
من از منوی project و بعد add new Item یه windows Form اضافه کردم ولی وقتی به یکی از دکم هام دستور نمایش اون رو میدم ایراد می گیره
میشه توضیح بدید که چیکارش باید کرد؟

BORHAN TEC
پنج شنبه 22 دی 1390, 12:18 عصر
در کد زیر نحوه انجام کار رو نشان داده ام که می توانید از آن استفاده کنید:
namespace WindowsApplication1;
interface
uses
System.Drawing,
System.Collections,
System.Collections.Generic,
System.Linq,
System.Windows.Forms,
System.ComponentModel;
type
MainForm = partial class(System.Windows.Forms.Form)
private
method button1_Click(sender: System.Object; e: System.EventArgs);
protected
method Dispose(disposing: Boolean); override;
public
constructor;
// Look at This
frm : Form2;
///////////////
end;
implementation
constructor MainForm;
begin
InitializeComponent();
end;
method MainForm.Dispose(disposing: Boolean);
begin
if disposing then begin
if assigned(components) then
components.Dispose();
end;
inherited Dispose(disposing);
end;

method MainForm.button1_Click(sender: System.Object; e: System.EventArgs);
begin
// Look at This
frm:= new Form2();
frm.Show(); // or frm.ShowDialog();
/////////////////
end;
end.