473,386 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

showing the version number in a labels text

I would like to know how I can show the version number of my program in the text
for a label on a windows form.

I'm not sure whether it is possible using visual basic standard 2002

any help would be greatly appreciated.

thanks.
Nov 20 '05 #1
8 1615
Cor
Hi The One,
I would like to know how I can show the version number of my program in the text for a label on a windows form.

I'm not sure whether it is possible using visual basic standard 2002

I dont know that either, but I should not know why not.

Put this in your form
\\\
Dim meAssem As New AssemblyInfo
label=meAssem.Version
///
And this on the end of your assembly.vb
\\\
Public Class AssemblyInfo
Private myType As Type
Public Sub New()
myType = GetType(form1) ' assuming your main form is form1
End Sub
Public ReadOnly Property Version() As String
Get
Return myType.Assembly.GetName.Version.ToString()
End Get
End Property
End Class
///
I hope this helps a little bit?
Cor
Nov 20 '05 #2
Hi One,

Here's a wee selection:

Dim S$

S$ = Application.ProductVersion

S$ = System.Diagnostics. _
FileVersionInfo.GetVersionInfo _
(Application.ExecutablePath).ProductVersion

S$ = System.Reflection. _
Assembly.GetExecutingAssembly.GetName().Version.To String

lblVersion.Text = S$

Regards,
Fergus
Nov 20 '05 #3
* "Fergus Cooney" <fi*****@post.com> scripsit:
Here's a wee selection:

Dim S$

^

*grrr*

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
Hi Herfried,

*grrr*

ROFLMAO

I converted a QBasic program the other day and discovered just how retro
VB.NET really is - so few errors!!

I was just <waiting> for a time when I could use that old syntax in an
unimportant way. I was hoping you'd tell I couldn't use S$ but *grrr* is just
as funny. ;-))

Regards,
Fergus
Nov 20 '05 #5
* "Fergus Cooney" <fi*****@post.com> scripsit:
I converted a QBasic program the other day and discovered just how retro
VB.NET really is - so few errors!!

I was just <waiting> for a time when I could use that old syntax in an
unimportant way. I was hoping you'd tell I couldn't use S$ but *grrr* is just
as funny. ;-))


Some people would say that using type suffices is "bad practice".

;-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #6
Hi Herfried,

|| Some people would say that using type suffices is "bad practice".

LOL, That's a mild version of what I thought you'd say. I think using $,
%, etc is awful - in a new program - but acceptable in legacy programs.

Regards,
Fergus
Nov 20 '05 #7
* "Fergus Cooney" <fi*****@post.com> scripsit:
Some people would say that using type suffices is "bad practice".


LOL, That's a mild version of what I thought you'd say. I think using $,
%, etc is awful - in a new program - but acceptable in legacy programs.


ACK.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #8
thanks for that it works fine.

"Cor" <no*@non.com> wrote in message
news:3f**********************@reader21.wxs.nl...
Hi The One,
I would like to know how I can show the version number of my program in

the text
for a label on a windows form.

I'm not sure whether it is possible using visual basic standard 2002

I dont know that either, but I should not know why not.

Put this in your form
\\\
Dim meAssem As New AssemblyInfo
label=meAssem.Version
///
And this on the end of your assembly.vb
\\\
Public Class AssemblyInfo
Private myType As Type
Public Sub New()
myType = GetType(form1) ' assuming your main form is form1
End Sub
Public ReadOnly Property Version() As String
Get
Return myType.Assembly.GetName.Version.ToString()
End Get
End Property
End Class
///
I hope this helps a little bit?
Cor


Nov 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Martin O'Rourke | last post by:
All, I am hoping someone might be able to put me out of my misery and let me know if it is possible or not to dervie the name of an element in a form, based on its associated label, only knowing...
3
by: CSDunn | last post by:
Hello, I have a situation with MS Access 2000 in which I need to display report data in spreadsheet orientation (much like a datasheet view for a form). If you think of the report in terms of what...
6
by: robin9876 | last post by:
In an Access 97 (and 2000) database that has linked tables to Oracle which is showing some fields as text when they are numbers in Oracle. In Oracle they are specified to a size e.g. Number(38)....
1
by: Darren D'Orlando | last post by:
I recently had a problem with my computer, the keyboard stopped working. I fixed that then I couldn't connect to the my IIS server, it no longer recognized my computer as a server...So I...
2
by: ricktech101 | last post by:
Hi, I have a table with a field that shows the number of pieces that a parcel contains. It looks like this: ParcelID, Pieces, Description Data example: 1001, 5, Jackets 1002, 10, shoes etc
8
by: Luke Davis | last post by:
When I run this codebehind on page load, none of the labels update, and I don't get any errors. See if you can figure it out: public partial class _Default : System.Web.UI.Page { protected...
3
by: trgpham | last post by:
hi all, I have created a new form (frmTEST) with a few labels, text boxes and 1 public procedure (public sub RetrieveValue). When I go to another form, trying to call the sub RetrieveValue in...
1
by: Andy B | last post by:
I have this code: protected void EditEventsWizard_NextButtonClick(object sender, WizardNavigationEventArgs e) { //get the values from the DetailsView TextBox StartTime =...
1
by: Bram | last post by:
Someone with very little computer experience is having problems with the label wizard. She is able to create a new label report, but the result only contains numbers. It is an address database and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.