Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
2.78/5 (3 votes)
See more:
Hi all

Below is my code

VB
Private Sub ChangeLanguage(ByVal lang As String)
      For Each c As Control In Me.Controls
          Dim resources As ComponentResourceManager = New ComponentResourceManager(GetType(MainWindow))
          resources.ApplyResources(c, c.Name, New CultureInfo(lang))
      Next c
  End Sub


i want to change language of controls on a combo box selection

but it's giving error
'Controls' is not a member of 'CulturalInfo.MainWindow'.

Please tell me the problem.
Posted

Hi,

Look at this.

Language Specific Settings [^]

Thanks!
 
Share this answer
 
Comments
Snehasish00 4-Nov-13 2:26am    
I am looking for windows application..
[no name] 4-Nov-13 3:37am    
http://msdn.microsoft.com/en-us/library/b28bx3bh(v=vs.110).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1
Language Specific Settings for Windows Forms Application

Language Culture Settings[^]
 
Share this answer
 
the problem is that you try to use code from WinForms application in WPF one. WPF Window class is a different thing from WinForms Form class. There is no Controls property there, exactly as your error message says. If you really need to work on WPF project, read something about WPF first
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900