1) THIS IS A CLASS, HOW WOULD I READ THESE PROPERTIES FROM IT (EX: MSGBOX(assem.copyright)) to get that property
===========================================================
Imports System.Reflection
Public Class Assem
Public ReadOnly Property ProjectDescription()
Get
Dim asm As AssemblyDescriptionAttribute
asm = Attribute.GetCustomAttribute([Assembly].GetExecutingAssembly, GetType(AssemblyDescriptionAttribute))
Return asm.Description
End Get
End Property
Public ReadOnly Property Copyright()
Get
Dim asm As AssemblyCopyrightAttribute
asm = Attribute.GetCustomAttribute([Assembly].GetExecutingAssembly, GetType(AssemblyCopyrightAttribute))
Return asm.Copyright
End Get
End Property
Public ReadOnly Property Company()
Get
Dim asm As AssemblyCompanyAttribute
asm = Attribute.GetCustomAttribute([Assembly].GetExecutingAssembly, GetType(AssemblyCompanyAttribute))
Return asm.Company
End Get
End Property
Public ReadOnly Property Title()
Get
Dim asm As AssemblyTitleAttribute
asm = Attribute.GetCustomAttribute([Assembly].GetExecutingAssembly, GetType(AssemblyTitleAttribute))
Return asm.Title
End Get
End Property
Public ReadOnly Property Trademark()
Get
Dim asm As AssemblyTrademarkAttribute
asm = Attribute.GetCustomAttribute([Assembly].GetExecutingAssembly, GetType(AssemblyTrademarkAttribute))
Return asm.Trademark
End Get
End Property
Public ReadOnly Property VersionMajor()
Get
Dim Ver As [Assembly]
Return Ver.GetExecutingAssembly().GetName().Version.Major
End Get
End Property
Public ReadOnly Property VersionMinor()
Get
Dim Ver As [Assembly]
Return Ver.GetExecutingAssembly().GetName().Version.Minor
End Get
End Property
Public ReadOnly Property VersionBuild()
Get
Dim Ver As [Assembly]
Return Ver.GetExecutingAssembly().GetName().Version.Build
End Get
End Property
Public ReadOnly Property VersionRevision()
Get
Dim Ver As [Assembly]
Return Ver.GetExecutingAssembly().GetName().Version.Revision
End Get
End Property
Public ReadOnly Property Version()
Get
Dim p_VerMajor, p_VerMinor, p_Build, p_Revision As String
Dim Ver As [Assembly]
p_VerMajor = Ver.GetExecutingAssembly().GetName().Version.Major
p_VerMinor = Ver.GetExecutingAssembly().GetName().Version.Minor
p_Build = Ver.GetExecutingAssembly().GetName().Version.Build
p_Revision = Ver.GetExecutingAssembly().GetName().Version.Revision
Return p_VerMajor & "." & p_VerMinor & "." & p_Build & "." & p_Revision
End Get
End Property
Public Sub Dispose()
Me.Dispose()
End Sub
End Class
===========================================================
2)I have a few forms on this project, and for the startup form I placed this code in the auto generated code region:
================
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
cstart = Me
'Add any initialization after the InitializeComponent() call
End Sub
=================
This is the first procedure in the auto generated code*
and as you can see I added "cstart = me", and on a class I have i set "Public cstart As fstart" because fstart is the startup form and I cant set "cstart" to equal a "new fstart" since it wont be opened by any command like (cstart.show). Anyway this works fine and I can communicate
between this form on other forms, but on the class where I declared "Public cstart As fstart" i also have this line of code:
"Public listfonta As New Font(cstart.contactl.Font, FontStyle.Regular)"
and as you can see it is getting a property from the startup form which is set it to equal "me" on the line I added in the auto-gen code. The problem is that the class with the "listfonta" variable and the other code executes before the auto-gen code does for the startup form, and this creates an error when its trying to set the "listfonta" variable since "cstart" isn't set to anything yet. Is there any way to make it excecute the code on the class after the auto-gen code on the startup form, or possible change the orded of which forms / classes excecute? and is there some set order defaultedly that the forms / classes excecute?
_________
thanks
===========================================================
Imports System.Reflection
Public Class Assem
Public ReadOnly Property ProjectDescription()
Get
Dim asm As AssemblyDescriptionAttribute
asm = Attribute.GetCustomAttribute([Assembly].GetExecutingAssembly, GetType(AssemblyDescriptionAttribute))
Return asm.Description
End Get
End Property
Public ReadOnly Property Copyright()
Get
Dim asm As AssemblyCopyrightAttribute
asm = Attribute.GetCustomAttribute([Assembly].GetExecutingAssembly, GetType(AssemblyCopyrightAttribute))
Return asm.Copyright
End Get
End Property
Public ReadOnly Property Company()
Get
Dim asm As AssemblyCompanyAttribute
asm = Attribute.GetCustomAttribute([Assembly].GetExecutingAssembly, GetType(AssemblyCompanyAttribute))
Return asm.Company
End Get
End Property
Public ReadOnly Property Title()
Get
Dim asm As AssemblyTitleAttribute
asm = Attribute.GetCustomAttribute([Assembly].GetExecutingAssembly, GetType(AssemblyTitleAttribute))
Return asm.Title
End Get
End Property
Public ReadOnly Property Trademark()
Get
Dim asm As AssemblyTrademarkAttribute
asm = Attribute.GetCustomAttribute([Assembly].GetExecutingAssembly, GetType(AssemblyTrademarkAttribute))
Return asm.Trademark
End Get
End Property
Public ReadOnly Property VersionMajor()
Get
Dim Ver As [Assembly]
Return Ver.GetExecutingAssembly().GetName().Version.Major
End Get
End Property
Public ReadOnly Property VersionMinor()
Get
Dim Ver As [Assembly]
Return Ver.GetExecutingAssembly().GetName().Version.Minor
End Get
End Property
Public ReadOnly Property VersionBuild()
Get
Dim Ver As [Assembly]
Return Ver.GetExecutingAssembly().GetName().Version.Build
End Get
End Property
Public ReadOnly Property VersionRevision()
Get
Dim Ver As [Assembly]
Return Ver.GetExecutingAssembly().GetName().Version.Revision
End Get
End Property
Public ReadOnly Property Version()
Get
Dim p_VerMajor, p_VerMinor, p_Build, p_Revision As String
Dim Ver As [Assembly]
p_VerMajor = Ver.GetExecutingAssembly().GetName().Version.Major
p_VerMinor = Ver.GetExecutingAssembly().GetName().Version.Minor
p_Build = Ver.GetExecutingAssembly().GetName().Version.Build
p_Revision = Ver.GetExecutingAssembly().GetName().Version.Revision
Return p_VerMajor & "." & p_VerMinor & "." & p_Build & "." & p_Revision
End Get
End Property
Public Sub Dispose()
Me.Dispose()
End Sub
End Class
===========================================================
2)I have a few forms on this project, and for the startup form I placed this code in the auto generated code region:
================
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
cstart = Me
'Add any initialization after the InitializeComponent() call
End Sub
=================
This is the first procedure in the auto generated code*
and as you can see I added "cstart = me", and on a class I have i set "Public cstart As fstart" because fstart is the startup form and I cant set "cstart" to equal a "new fstart" since it wont be opened by any command like (cstart.show). Anyway this works fine and I can communicate
between this form on other forms, but on the class where I declared "Public cstart As fstart" i also have this line of code:
"Public listfonta As New Font(cstart.contactl.Font, FontStyle.Regular)"
and as you can see it is getting a property from the startup form which is set it to equal "me" on the line I added in the auto-gen code. The problem is that the class with the "listfonta" variable and the other code executes before the auto-gen code does for the startup form, and this creates an error when its trying to set the "listfonta" variable since "cstart" isn't set to anything yet. Is there any way to make it excecute the code on the class after the auto-gen code on the startup form, or possible change the orded of which forms / classes excecute? and is there some set order defaultedly that the forms / classes excecute?
_________
thanks