Current Deployment Version on Windows Form Title (C#)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RobyV
    New Member
    • Feb 2010
    • 4

    Current Deployment Version on Windows Form Title (C#)

    I was checking online how to get the deployment version to put in the title of the main form, and the thread I found here on Bytes just missed few things.
    That is the main why I registered and join this really useful community.

    Here below is how to get the deployment version on the title of the main form (at least the solution I found :)):
    In the load event of the form:
    try
    {
    this.Text += " - [v: " + System.Deployme nt.Application. ApplicationDepl oyment.CurrentD eployment.Curre ntVersion.ToStr ing() + "]";
    }
    catch
    {
    this.Text += "what yuo want";
    }
    Just an explanation: this try catch is only to avoid the error while testing the application before publishing. Once published you will get the current deployment version on the title of the main form.

    Hope my first tip will help.
Working...