做了一个完整的,不过不是多窗体的。
工程名:DDETRY,窗体名:FRMTRY,PICTURE名:P,RTFBOX名:TEXT1
Option Explicit
Private Sub Form_LinkExecute(CmdStr As String, Cancel As Integer)
Dim Tmp As String
If CmdStr <> "" Then
Tmp = CmdStr
If Left(Tmp, 1) = Chr(34) Then Tmp = Right(Tmp, Len(Tmp) - 1)
If Right(Tmp, 1) = Chr(34) Then Tmp = Left(Tmp, Len(Tmp) - 1)
Text1.Text = ""
Text1.FileName = Tmp
Me.Caption = Tmp
End If
Cancel = False
End Sub
Private Sub Form_Load()
Dim Tmp As String
If App.PrevInstance = True Then
Me.LinkMode = 0
Me.LinkTopic = ""
P.LinkMode = 0
P.LinkTopic = "DDETry|FrmTry"
P.LinkMode = 2
P.LinkExecute Command
End
Else
If Command <> "" Then
Tmp = Command$
If Left(Tmp, 1) = Chr(34) Then Tmp = Right(Tmp, Len(Tmp) - 1)
If Right(Tmp, 1) = Chr(34) Then Tmp = Left(Tmp, Len(Tmp) - 1)
Text1.FileName = Tmp
Me.Caption = Tmp
End If
End If
Text1.Top = 0
Text1.Left = 0
End Sub
Private Sub Form_Resize()
Text1.Height = Me.ScaleHeight
Text1.Width = Me.ScaleWidth
End Sub