Culture Change doesn't Refresh Controls

Hi,

I have an application that allows the user to change the language at will during run time. However, i am running into a small problem when it comes to controls on forms. Actually, the only place where the problem occurs is on dialog forms. Here are the steps i am taking to reproduce the error:

1 start application
2 open search and perform search
3 select record, and hit @View@ (dialog form)
4 Hit cancel
5 Change the language (this changes my search form controls without problems (MDI Child form), and the thread culture as well)
6 Perform a search
7 select same record, and hit @View@ (dialog form)

At this point, all of my controls within the dialog form are in the previous language/haven't changed.

I am wondering if there is anything special i should be doing to refresh the controls to the proper UI culture. I know that the UI culture has properly been changed because part of the dialog box content is pulled from the DB based on the current culture... so that textbox content is in the proper language, but the controls on the dialog box remain unchanged.

I have tried many things to get this to work, including:

Form Load Event
Me.refresh()
Application.DoEvents()
InitializeComponent() (this effectively clears my entire form, not what i want)

Debug and check that the culture has been changed (it has) on dialog form load...

I am at a loss as to why this only happens on the dialog boxes... all my other forms perform properly. Here's the code to change the culture, maybe something is wrong there... please help! :
Public Sub SetLanguageCulture()
        If LanguageCode = "F" Then
            m_CurrentCulture = New CultureInfo("fr-CA")
            Threading.Thread.CurrentThread.CurrentUICulture = m_CurrentCulture
            Threading.Thread.CurrentThread.CurrentCulture = m_CurrentCulture
        ElseIf LanguageCode = "E" Then
            m_CurrentCulture = New CultureInfo("en-CA")
            Threading.Thread.CurrentThread.CurrentUICulture = m_CurrentCulture
            Threading.Thread.CurrentThread.CurrentCulture = m_CurrentCulture
        End If
    End Sub

Open in new window

LVL 10
MaxOvrdrv2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MaxOvrdrv2Author Commented:
Ah man... i hate it when this happens... =S I actually found the answer to my problem... the reason why the dialog boxes were not changing UI cultures is that apparently, Me.Close(), keeps all the language culture information into memory somehow... i decided to try Me.Dispose() instead, and it works properly for all my dialog boxes now... really sorry for the useless post.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.