Results 1 to 2 of 2

Thread: an Api to change the regional settings in VB

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    455

    an Api to change the regional settings in VB

    Dear VB users,

    Is it possible with the use of VB the regional settings to change.
    For example I want to change the decimal symbol from “.” to “,”
    Can some give me source?

    Nice regards,

    Michelle.

  2. #2
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    Use the SetLocaleInfo function for this.

    eg
    Code:
    Private Declare Function SetLocaleInfo Lib "kernel32" Alias "SetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String) As Long
    Private Const LOCALE_SDECIMAL = &HE         '  decimal separator
    Private Const LOCALE_STHOUSAND = &HF         '  thousand separator
    Private Const LOCALE_USER_DEFAULT = &H400
    
    Private Sub Command1_Click()
        Dim sLocale As String
        Dim retVal As Long
        sLocale = "."
        retVal = SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, sLocale)
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width