0

私はvb.netとelseステートメントにmsgboxを持っています.....文字列値を渡して、文字列とメッセージテキストを以下のように表示したい-

Normal

    msgbox("student is not eligible for the company")

TO

    MSGBOX([string]"is not eligible for the company")

RESULT

    Anthony is not eligible for the company

これに関する回避策はありますか........?

4

1 に答える 1

4
dim StudentName as string
StudentName = "Student"

If (specificStudent) Then
   StudentName = "SpecificName"
End If

MsgBox(StudentName + " is not eligible")

string.Format編集:また、ここで使用できます

dim StudentName as string
StudentName = "Student"

If (specificStudent) Then
   StudentName = "SpecificName"
End If

'I suppose string.format works same way in vb.net, as it does in c#    
MsgBox(String.Format("{0} is not eligible", StudentName))
于 2013-02-24T18:52:14.487 に答える