unit2.~pas

来自「用Delphi语言实现的串口通讯」· ~PAS 代码 · 共 51 行

~PAS
51
字号
unit Unit2;

interface

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

type
  TForm2 = class(TForm)
    GroupBox1: TGroupBox;
    BitBtn1: TBitBtn;
    Label1: TLabel;
    ComboBoxCom: TComboBox;
    Label2: TLabel;
    ComboBoxB: TComboBox;
    Label3: TLabel;
    Label4: TLabel;
    procedure BitBtn1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

uses Unit1;

{$R *.dfm}

procedure TForm2.BitBtn1Click(Sender: TObject);
begin
  Form1.CurrentComPort := ComboBoxCom.text;
  Form1.BaudRate       := StrToInt(ComboBoxB.Text);
  Close;
end;


procedure TForm2.FormShow(Sender: TObject);
begin
  ComboBoxCom.ItemIndex := 0;
  ComboBoxB.ItemIndex   := 3;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?