Showdialog Bilingual Problem

5 posts, 0 answers
  1. meraj
    meraj avatar
    47 posts
    Member since:
    Dec 2010

    Posted 05 Mar 2011 Link to this post

    Hi
    I am working in bilingual form
          when i call a form as Showdialog then it cant be change as culture .
          Like when i want to see English in English culture and Arabic in Arabic culture.
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 05 Mar 2011 Link to this post

    Hello Meraj,

    What exactly is it you wish to localize? The Telerik controls have excellent localiztion support. If you go to the winforms help section and then under the control you wish to localize, have a look at the localization topic you will find how to do this.

    The controls that can be localized do so by you providing a localization provider that you set on the form for the control in question
    Hope this helps
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. meraj
    meraj avatar
    47 posts
    Member since:
    Dec 2010

    Posted 05 Mar 2011 Link to this post

    'show dailog code:

    frmFrequencyPayment.DefInstance.Show()

    'Culture Changing Code

    System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo(CultureName)
    System.Threading.Thread.CurrentThread.UiCulture  = New System.Globalization.CultureInfo(CultureName)

    InitializeComponent()

    System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(CalendarCulture)
    System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(CalendarCulture)

    Dim df as new System.Globalization.DateTimeFormatInfo
    df.ShortDatePattern = "dd/MM/yyyyy"

    System.Threading.Thread.CurrentThread..CurrentCulture.DateTimeFormat = df




  5. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 05 Mar 2011 Link to this post

    Hello Meraj,

    If you can explain your issue in detail then I will be happy to try and help. If you need to add supporting screenshots or code using the Format Code block then this may also help
    thanks
    Richard
  6. meraj
    meraj avatar
    47 posts
    Member since:
    Dec 2010

    Posted 05 Mar 2011 Link to this post

    1. frmDialog is used as a dialog box
    Below Code Is used for Culture for form frmDialog

    *Note -CultureName is a public variable which is either "en-US" or "ar-SA"

    Public Sub New()
               System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo(CultureName)
               System.Threading.Thread.CurrentThread.UiCulture  = New System.Globalization.CultureInfo(CultureName)

                InitializeComponent()

    End Sub

    2.frmCustomer
    Below code is called from frmCustomer after button click
    Private Sub btnShowfrmDialog ( Byval sender as System.Object, Byval e as system.EventArgs) Handles btnCustomDepreciation.Click

    frmCustomDepreciation.ShowDialog()

    End Sub

    problem is that when is use frmCustomDepreciation.Show() ,frmDialog  is working fine means
    its showing in English when culture is " en-US" or   in Arabic when culture is "ar-SA"  .
    But when i used frmCustomDepreciation.ShowDialog() ,frmDialog shows only default culture .
    My Default culture is Arabic when i set the English culture, frmDialog not shows English.

Back to Top
UI for WinForms is Visual Studio 2017 Ready