Imports System.Text
Public Class Form1
#Region "Event handlers"
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles Me.Load
ShowMessage()
End
End Sub
#End Region
#Region "Protected methods"
Protected Sub ShowMessage()
Try
Dim strMsg As String = MessageBuild()
If Not strMsg Is Nothing Then
MsgBox(strMsg, MsgBoxStyle.Information)
End If
Catch ex As Exception
MsgBox(ex.ToString, MsgBoxStyle.Critical)
End Try
End Sub
Protected Overridable Function MessageBuild( _
Optional ByVal strLanguageDescr = "ελληνικά") As String
Dim strMsg As String = Nothing
Try
Dim strLanguage As String = "γλώσσα"
Dim strPlease As String = "Παρακαλώ"
strMsg = String.Format("{0} να γράφετε μόνο {1}, " & _
"γιατί δεν μιλάω άλλη {2}.", _
strPlease, _
strLanguageDescr, _
strLanguage)
Catch ex As Exception
Throw ex
End Try
Return strMsg
End Function
#End Region
End Class
