Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
360
ultraTabPagecontrol and resources
posted

Hello,

I have a problem to translate the resources of my Forms which are set to Localizable to true.

I have noticed that the ultraTabPageControl has not any Text property.

Into the resrouces file I can see items for TabPageControl objects, but their IDS came from the objects' name automatically generated from design.

So, the problem is, if we remove a tabPage and create a new one, the tabPage name does not re-use the last free tabnumber; I mean the name is always incrementing, even if one tabPage has been deleted.

 

Because of that, that piece of code added to bypass the fact the the TabPageControl has no Text property can not fully solve the problem:

 

control.Text = (string)GetSafeValue(resources, control.Name + ".Text", control.Text);
if (control is Infragistics.Win.UltraWinTabControl.UltraTabPageControl)
{
       Infragistics.Win.UltraWinTabControl.UltraTabPageControl tabPageControl =     (Infragistics.Win.UltraWinTabControl.UltraTabPageControl) control;
       if (tabPageControl.Tab != null)
       {
             control.Text = (String) GetSafeValue(resources, tabPageControl.Tab.Key + ".Text",  tabPageControl.Tab.Text);
       }
}

 

I think also that the reason of the problem is because the tabPageControl has no "Name" property, like it is for standrad windows  TabPage control.

 

 

We are experiencing same problem with statusbar control, and ultraTree.

Parents
  • 360
    Suggested Answer
    posted

    To let you understand my problem more easily, here are a sample project.

    Please run project "TestSDIApp" to test.

    Under folder "FormLanguangeML" you can find a file "FormLanguangeML.loc" which is a file created by Lingobit application (availabe in demo version), used to manage resources for different languages.

    Into  "\Sample\TestSDIApp\FormMain.resx" you can see that the Infragistics tab controls are detected into resources as "ultraTab1.Text" and "ultraTab2.Text".

    Into "\Sample\FormLanguageSwitch\FormLanguageSwitch.cs" you see the method:

    protected virtual void ReloadTextForSelectedControls(System.Windows.Forms.Control control, System.Resources.ResourceManager resources)

    which i had to modify to force the applying of resources for Infragistics tab controls.

     

    After that, you can remove one infragistics tab page, recreate a new tab page, and notice that the new tab page is "ultraTab3" and because tab page object has not "Name" property and also because the "Accessibility" property doesn't allow to retrieve the object name value, i must add manually a "key" value the to  tab page control.

    --> this way of work is not good neither safe into a big project (when some developers are working on it).

     

     

    Sample.zip
Reply Children