If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: How Do I Display Application's Version Info?

lblVersion.Text = "Version " & Application.ProductVersion

Should do the trick.. . .

--
Jacob Grass
Microsoft .NET MVP

"James Graham" <graham@iucf.indiana.edu> wrote in message
news:3c978336$1@10.1.10.29...
>
> In VB6, it was easy to display the app's version information (major,
minor,
> revision) in a textbox or a label.
>
> All I had to do (if I recall correctly) is the following:
>
> Let's say I want to display major version info in a label called "label1":
>
> label1.caption=app.major
>
> Likewise, I could concatenate the version info strings (major, minor, etc)
> into one string and display it just as easily.
>
> I have yet to figure out how to do this with VB.NET.
>
> Suppose I have a label called "lblVersion".
>
> How would I display all of the available application version information
> within this label?
>
> All I want is a line of text displayed on my app's form that looks similar
> to the following:
>
> "Version 1.0.0.1"
>
> Thanks,
> Jim Graham
> --
> graham@iucf.indiana.edu
>

"Jacob Grass" <JGrass@AbilitiSolutions.com> wrote:
>lblVersion.Text = "Version " & Application.ProductVersion
>
>Should do the trick.. . .
>
>--
>Jacob Grass
>Microsoft .NET MVP
>
>"James Graham" <graham@iucf.indiana.edu> wrote in message
>news:3c978336$1@10.1.10.29...
>>
>> In VB6, it was easy to display the app's version information (major,
>minor,
>> revision) in a textbox or a label.
>>
>> All I had to do (if I recall correctly) is the following:
>>
>> Let's say I want to display major version info in a label called "label1":
>>
>> label1.caption=app.major
>>
>> Likewise, I could concatenate the version info strings (major, minor,
etc)
>> into one string and display it just as easily.
>>
>> I have yet to figure out how to do this with VB.NET.
>>
>> Suppose I have a label called "lblVersion".
>>
>> How would I display all of the available application version information
>> within this label?
>>
>> All I want is a line of text displayed on my app's form that looks similar
>> to the following:
>>
>> "Version 1.0.0.1"
>>
>> Thanks,
>> Jim Graham
>> --
>> graham@iucf.indiana.edu
>>
>
>

Re: How Do I Display Application's Version Info?

Re: How Do I Display Application's Version Info?

Not that I can tell.
I've installed vs.net on a different machine just to see if there was a "bad
install". I get the same symptoms.

However, I've observed some new behavior which I (being new to VB.net) certainly
cannot explain.

The code:
lblVersion.text=Application.ProductVersion

actually works, reporting the information requested and with no errors.

However, this only true for a project developed using the "Windows Application"
template. What I'm developing is a project using the "Windows Control Library"
template. THIS is where the problem occurs.

I'm developing a control to display a virtual "LED" indicator. The control
has a number of custom properties defined by me. One of those properties
is to display an "About" window. It is on this "About" window from that
I'm trying to display the version of the usercontrol.

To test, I have brought in a "test" form on which I can place my new control.
I drop a control onto the form, then I double-click on the control's "About"
property and up pops my "About" window, but shortly prior to that, I get
the devenv.exe error.

I mentioned earlier that the "Application.ProductVersion" works in a normal
windows application form. However, it bombs if I try to place my custom
control on the application's main form, but textbox, label and other Microsoft
controls seem to be happy when I invoke the above. This tells me it's something
I'm doing wrong with my custom control...at design-time. Maybe it's simple.
Maybe I'm not supposed to use the "Application.ProductVersion" call from
a usercontrol????

Re: How Do I Display Application's Version Info?

James-

Okay, that helps narrow down the problem a bit. The Application class is
really only applicable in a situation where a MessageLoop is being created.
This occurs with Windows Applications, not Class/Control libraries or
UserControls. UserControls (Control libraries) versioning info exists in
the AssemblyInfo.vb file. I am not sure how to retreive this information at
runtime. Perhaps someone else can chime in with their expertise.

--
Jacob Grass
Microsoft .NET MVP

"James Graham" <graham@iucf.indiana.edu> wrote in message
news:3c98d07e$1@10.1.10.29...
>
> Not that I can tell.
> I've installed vs.net on a different machine just to see if there was a
"bad
> install". I get the same symptoms.
>
> However, I've observed some new behavior which I (being new to VB.net)
certainly
> cannot explain.
>
> The code:
> lblVersion.text=Application.ProductVersion
>
> actually works, reporting the information requested and with no errors.
>
> However, this only true for a project developed using the "Windows
Application"
> template. What I'm developing is a project using the "Windows Control
Library"
> template. THIS is where the problem occurs.
>
> I'm developing a control to display a virtual "LED" indicator. The
control
> has a number of custom properties defined by me. One of those properties
> is to display an "About" window. It is on this "About" window from that
> I'm trying to display the version of the usercontrol.
>
> To test, I have brought in a "test" form on which I can place my new
control.
> I drop a control onto the form, then I double-click on the control's
"About"
> property and up pops my "About" window, but shortly prior to that, I get
> the devenv.exe error.
>
> I mentioned earlier that the "Application.ProductVersion" works in a
normal
> windows application form. However, it bombs if I try to place my custom
> control on the application's main form, but textbox, label and other
Microsoft
> controls seem to be happy when I invoke the above. This tells me it's
something
> I'm doing wrong with my custom control...at design-time. Maybe it's
simple.
> Maybe I'm not supposed to use the "Application.ProductVersion" call from
> a usercontrol????
>
> Thanks,
> Jim Graham
> --
> graham@iucf.indiana.edu
>
>
>
> "Jacob Grass" <JGrass@AbilitiSolutions.com> wrote:
> >> Unless you are doing something with a Managed C++ app?
> >
> ^^
> >
> Un
> >
> >
> >--
> >Jacob Grass
> >Microsoft .NET MVP
> >
> >
> >
>

Re: How Do I Display Application's Version Info?

>UserControls (Control libraries) versioning info exists in
>the AssemblyInfo.vb file. I am not sure how to retreive this information at
>runtime. Perhaps someone else can chime in with their expertise.

AssemblyVersionAttribute is a pseudo-custom attribute that ends up
being part of the assembly name. It can be retrieved with