您的位置首页百科知识

VB中如何令按钮按后变Caption并改变代码?

VB中如何令按钮按后变Caption并改变代码?

修改如下:Private Sub Command2_Click(Index As Integer) If Command2(竖岁index).Caption = "打开串口"余贺睁拍裤 Then MSComm1.PortOpen = True Command2(index).Caption = "关闭串口" Else Command2(index).Caption = "打开串口" MSComm1.PortOpen = False End IfEnd Sub