Visual Basic Foro
Programación => Visual Basic 6 => Mensaje iniciado por: Bazooka en Junio 07, 2014, 10:54:09 am
-
Hola amigos tengo esta funcion que me devuelve informacion del panel de control necesaria para que funcione correctamente mi aplicacion!
Ahora me gustaria cambiarla la moneda y el simbolo decimal desde mi codigo y luego restaurarlo al salir de la aplicacion!!
mi code
Private Function VERIFICA_CONFIG_REGIONAL() As Boolean
On Error Resume Next
Dim Tmp As String
Dim INTENTO As Boolean
10 Tmp = Leer_Dato(CurrentUser, "sCurrency")
If Tmp <> "$" Then
VERIFICA_CONFIG_REGIONAL = True
End If
Tmp = Leer_Dato(CurrentUser, "sThousand")
If Tmp <> "." Then
VERIFICA_CONFIG_REGIONAL = True
End If
End Function
-
ya encontre lo que buscaba!!!
Private Declare Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String, ByVal cchData As Long) As Long
Private Declare Function SetLocaleInfo Lib "kernel32" Alias "SetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String) As Boolean
Private Const LOCALE_SYSTEM_DEFAULT = &H800 ''presentar información del sistema
Private Const LOCALE_USER_DEFAULT = &H400 ''presentar información del usuario
Private Const LOCALE_SDECIMAL = &HE '' decimal separator
Private Const LOCALE_STHOUSAND = &HF '' thousand separator
Public Sub Activar_regional()
Dim X&
X = SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, ". " )
X = SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, ", " )
End Sub
Public Sub Desactivar_regional()
Dim X&
X = SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, "," )
X = SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, ".")
End Sub