///
///Sets a pretty form caption using a given filename with version info.
///
private void SetCaption(string filename)
{
// Get assembly version info
Version ver = new Version(Application.ProductVersion);
// Format version major minor
string captionString = string.Format("{0} v{1}.{2}",
Application.ProductName, ver.Major, ver.Minor);
// Check for empty filename and set caption accordingly
if (filename != String.Empty)
this.Text = captionString + " [" + System.IO.Path.GetFileName(filename) + "]";
else
this.Text = captionString;
}
|