码迷,mamicode.com
首页 > Windows程序 > 详细

窗体showModal

时间:2016-08-08 00:41:55      阅读:228      评论:0      收藏:0      [点我收藏+]

标签:

技术分享
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons;

type
  TForm1 = class(TForm)
    btn1: TBitBtn;
    procedure btn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation
uses  Unit2;
{$R *.dfm}

procedure TForm1.btn1Click(Sender: TObject);
begin
  form2.ShowModal;
end;

end.
Delphi 窗体1的代码,按钮 点击Form showmodal

转换后

Unit2.cs 的代码为

using System;
using System.Windows.Forms;
using Unit2;
namespace Unit1
{
    public partial class TForm1: Form
    {
        public TForm1()
        {
            InitializeComponent();
        }

        public void btn1Click(System.Object Sender, System.EventArgs _e1)
        {
            Unit2.Units.Unit2.Form2.ShowDialog();//ShowDialog
        }

    } // end TForm1

}

namespace Unit1.Units
{
    public class Unit1
    {
        public static TForm1 Form1 = null;
    } // end Unit1

}

 

窗体showModal

标签:

原文地址:http://www.cnblogs.com/rogge7/p/5747680.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!