Click here to Skip to main content
15,907,913 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Saving Integer Array Pin
dan!sh 22-Oct-09 5:17
professional dan!sh 22-Oct-09 5:17 
QuestionHandle changes in the system control panel in application program Pin
gilchinger22-Oct-09 0:12
gilchinger22-Oct-09 0:12 
AnswerRe: Handle changes in the system control panel in application program Pin
dan!sh 22-Oct-09 0:50
professional dan!sh 22-Oct-09 0:50 
GeneralRe: Handle changes in the system control panel in application program Pin
gilchinger22-Oct-09 1:25
gilchinger22-Oct-09 1:25 
GeneralRe: Handle changes in the system control panel in application program Pin
dan!sh 22-Oct-09 1:45
professional dan!sh 22-Oct-09 1:45 
GeneralRe: Handle changes in the system control panel in application program Pin
gilchinger22-Oct-09 2:14
gilchinger22-Oct-09 2:14 
GeneralRe: Handle changes in the system control panel in application program Pin
dan!sh 22-Oct-09 3:51
professional dan!sh 22-Oct-09 3:51 
GeneralRe: Handle changes in the system control panel in application program Pin
gilchinger22-Oct-09 9:23
gilchinger22-Oct-09 9:23 
d@nish,

yes, perfect. I didn't see the methode ClearCachedData. Thank you.

So complete coding is as follows. If the event is triggered for new settings in the windows control panel the Cached Info in the culture objects in cleared and a new transfer occurs from the datavariables to the frontend.


Imports System
Imports Microsoft.Win32
Imports System.Windows.Forms


Public Class Form1

    Public Sub New()

        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Adds Handler to receive Events for any changes in the windows control panel 
        AddHandler SystemEvents.UserPreferenceChanging, AddressOf SystemEvents_UserPreferenceChanging

    End Sub

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.PutDataToUI()
    End Sub

    Private Sub SystemEvents_UserPreferenceChanging(ByVal sender As Object, ByVal e As UserPreferenceChangingEventArgs)
        If e.Category = UserPreferenceCategory.Locale Then
            My.Application.Culture.ClearCachedData()
            My.Application.UICulture.ClearCachedData()
            Me.PutDataToUI()
        Else
        End If
    End Sub

    ''' <summary>
    ''' Puts some data to an textbox 
    ''' </summary>
    ''' <remarks></remarks>
    Private Sub PutDataToUI()

        Me.TextBox1.Text = My.Application.Culture.DisplayName & vbCrLf _
                      & My.Application.Culture.EnglishName & vbCrLf _
                      & Now.ToLongDateString & vbCrLf _
                      & Now.ToLongTimeString & vbCrLf _
                      & Now.ToShortDateString & vbCrLf _
                      & Now.ToShortTimeString & vbCrLf _
                      & My.Application.Culture.Name & vbCrLf _
                      & My.Application.UICulture.NativeName
    End Sub

End Class




My be coding helps anybody.


regards,
bauer
GeneralRe: Handle changes in the system control panel in application program Pin
Eddy Vluggen22-Oct-09 7:21
professionalEddy Vluggen22-Oct-09 7:21 
GeneralRe: Handle changes in the system control panel in application program Pin
gilchinger22-Oct-09 10:23
gilchinger22-Oct-09 10:23 
GeneralRe: Handle changes in the system control panel in application program Pin
Eddy Vluggen22-Oct-09 10:51
professionalEddy Vluggen22-Oct-09 10:51 
QuestionA very simple question with a twist Pin
offroaderdan22-Oct-09 0:04
offroaderdan22-Oct-09 0:04 
AnswerRe: A very simple question with a twist Pin
dan!sh 22-Oct-09 0:07
professional dan!sh 22-Oct-09 0:07 
GeneralRe: A very simple question with a twist Pin
offroaderdan22-Oct-09 0:10
offroaderdan22-Oct-09 0:10 
GeneralRe: A very simple question with a twist Pin
dan!sh 22-Oct-09 0:12
professional dan!sh 22-Oct-09 0:12 
GeneralRe: A very simple question with a twist Pin
offroaderdan22-Oct-09 0:22
offroaderdan22-Oct-09 0:22 
GeneralRe: A very simple question with a twist Pin
dan!sh 22-Oct-09 0:46
professional dan!sh 22-Oct-09 0:46 
GeneralRe: A very simple question with a twist Pin
Dave Kreskowiak22-Oct-09 1:46
mveDave Kreskowiak22-Oct-09 1:46 
GeneralRe: A very simple question with a twist Pin
offroaderdan22-Oct-09 0:13
offroaderdan22-Oct-09 0:13 
GeneralRe: A very simple question with a twist Pin
offroaderdan22-Oct-09 0:32
offroaderdan22-Oct-09 0:32 
GeneralRe: A very simple question with a twist Pin
dan!sh 22-Oct-09 0:45
professional dan!sh 22-Oct-09 0:45 
GeneralRe: A very simple question with a twist Pin
offroaderdan22-Oct-09 1:01
offroaderdan22-Oct-09 1:01 
AnswerRe: A very simple question with a twist Pin
Steve Westbrook22-Oct-09 2:22
Steve Westbrook22-Oct-09 2:22 
QuestionXML Extraction using VB Pin
nhsal6921-Oct-09 22:51
nhsal6921-Oct-09 22:51 
AnswerRe: XML Extraction using VB Pin
Christian Graus21-Oct-09 23:42
protectorChristian Graus21-Oct-09 23:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.