Q&A

  • 포트 설정을 콤보 박스로 하려는데요...
안녕하세요...

ComboBox1를 사용하여 Items에 [Com1,Com2,Print]를 지정하고

아래와 같이 소스를 만들었습니다...

그런데... Com1에서는 인쇄가 잘 되는데...

케이블을 Com2로 연결하니까 발행이 되지 않는군요...

좀 도와주세요...

<소스>

procedure TForm1.ComboBox1Change(Sender: TObject);

begin

CommPortDriver1.DisConnect;

If ComboBox1.ItemIndex = 0 Then

CommPortDriver1.ComPort := pnCOM1

else If ComboBox1.ItemIndex = 1 Then

CommPortDriver1.ComPort := pnCOM2

else PrintDialog1.PrintToFile := True;

CommPortDriver1.Connect;

end;

0  COMMENTS