2016-06-02 12 views
0

私のイベントの1つでは、 "With ... End With Statement"を使用していますので、使用したメソッドから戻り値を取得する必要があります内部「で...ステートメントで終わる」私の第一の方法では関数内から呼び出された戻り値を取得... End Withステートメント

、私はつもりでに自分のコードを変更していますその後

Dim RetVal As MyApp.ErrorConstants 
RetVal = AgentApp.Login(txtUserName, txtPassword, txtStation) 

のように戻り値を取ることができます...で終わるを戻り値を取得する方法と戻り値を取得する方法

Dim RetVal As MyApp.ErrorConstants 

With AgentApp 
    .Login txtUserName, txtPassword, txtStation 
    .DisplayMessages = 0 
    .UISettings.SuppressErrors = False 
    .UISettings.SuppressMessages = False 
End With 

答えて

3

我々はこのように試すことができます

Dim RetVal As MyApp.ErrorConstants 

With AgentApp 
    RetVal = .Login(txtUserName, txtPassword, txtStation) 
    .DisplayMessages = 0 
    .UISettings.SuppressErrors = False 
    .UISettings.SuppressMessages = False 
End With 
+0

かなり明らかです。 – Bob77

関連する問題