Welcome to A1vbcode Mark. Well I don't find A1vbcode the best VB site for one reason. When you reply to a topic on all the other 25 VB forums that I use is you can't see the previous posts to copy and paste text. You have to have 2 browsers open. The other thing is posting code Public Function IsOsVista() As Boolean ' Declare local vars... Dim lMajor As Long Dim lMinor As Long ' Retrieve the actual info... GetWindowsVersion lMajor, lMinor ' Check which OS we're on and Assign Global vars... You'll only have to call ' the function once this way... ' OS is Vista If (lMajor = 6) Then IsOsVista = True m_IsVista = True m_IsXp = False m_IsW2K = False Me.Caption = "Vista True" ' OS is XP ElseIf (lMajor = 5) And (lMinor >= 1) Then IsOsVista = False m_IsVista = False m_IsXp = True m_IsW2K = False Me.Caption = "XP True" ' OS is W2K ElseIf (lMajor = 5) And (lMinor = 0) Then IsOsVista = False m_IsVista = False m_IsXp = False m_IsW2K = True Me.Caption = "Win2k True" End If End Function
as against Public Function IsOsVista() As Boolean
' Declare local vars... Dim lMajor As Long Dim lMinor As Long ' Retrieve the actual info... GetWindowsVersion lMajor, lMinor ' Check which OS we're on and Assign Global vars... You'll only have to call ' the function once this way... ' OS is Vista If (lMajor = 6) Then IsOsVista = True m_IsVista = True m_IsXp = False m_IsW2K = False Me.Caption = "Vista True" ' OS is XP ElseIf (lMajor = 5) And (lMinor >= 1) Then IsOsVista = False m_IsVista = False m_IsXp = True m_IsW2K = False Me.Caption = "XP True" ' OS is W2K ElseIf (lMajor = 5) And (lMinor = 0) Then IsOsVista = False m_IsVista = False m_IsXp = False m_IsW2K = True Me.Caption = "Win2k True" End If
End Function
This is Mark's way around it. Mark's Syntax.zip. Its a pity Mark's code doesn't work on other forums. You will find that forums that use VB6 and VB.Net separate these two languages in different sub forums. I won't tell you which is the best VB forum on the web, I presume you have found it.
Keith
I've been programming with VB for 17 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
|