누락 된 체크리스트 항목 목록을 반환하는 사용자를위한 메시지를 생성하려고합니다. 내 질문 : 새 줄을 포함하는 MessageBox에 전달할 수있는 메시지를 작성하는 방법이 있습니까? 나는 여러 가지 개별 메시지를 받아들이는 방법을 오버로딩하는 것을 고려해 왔지만 이것을하기위한보다 우아한 방법이 있어야한다. 아래는이 메시지 수집, 표시 및 향후 수출을보다 편리한 형식으로 처리하도록 설계된 클래스입니다.새 줄을 포함하도록 메시지 상자로 전달되는 MessageBox 메시지를 작성할 수 있습니까?
Public Class clsChecklistMissingItems
Private Shared iWrong As Integer = 0 'Number of items wrong.
Private Shared sMissingItems() As String 'Will use the number of items wrong.
Public Shared Sub CollectItem(ByVal mess As String) 'Saves the message passed to it.
ReDim Preserve sMissingItems(iWrong) 'Resize the array based on the counter.
sMissingItems(iWrong) = mess 'Assign the message to the missing items string array.
iWrong = iWrong + 1 'Increment the counter (may give us +1
End Sub
Public Sub DisplayList() 'Displays the message at the end of the execution.
'Can this be generated procedurally?
MessageBox.Show("There were " & iWrong & " missing or incorrect items." & vbNewLine &
sMissingItems(iWrong))
End Sub End Class
내 대체 솔루션은 텍스트 상자와 유사한 동작합니다 텍스트 상자와 같은 포맷 된 양식을 작성하는 것입니다,하지만 기술의 모든 기능을 제공합니다.
계속 진행하기 전에 정보를 모달 형태로 표시하여 사용자가 닫아야하는 경우가 있습니까? – Esko
"SOLVED"를 제목에 추가하지 마십시오. 답변을 게시하여 문제를 해결했음을 나타 냈습니다! –