Page 1 of 1

Main menu gets white background after language switch

Posted: Wed Feb 16, 2005 2:34 pm
by MainSoft
Hi,

Now that I have a working test drive of my app which is now using TsiLang, a new problem appeared. Whenever I switch to another language, the main menu bar gets a white background.

This is a known problem under XP for menus using an ImageList but usually, this is solved by assigning the ImageList dynamically during FormCreate instead of doing this at design time. In that case, this doesn't help, though.

Any fix?

Thanks in advance.

Posted: Wed Feb 16, 2005 3:39 pm
by isiticov
May be assigning ImageList property at design-time instead of run-time will solve this issue in this case?

Posted: Wed Feb 16, 2005 3:41 pm
by isiticov
Or re-assigning the ImageList in OnChangeLanguage event, like:

Code: Select all

MainMenu1.ImageList := nil;
MainMenu1.ImageList := ImageList1;

Posted: Wed Feb 16, 2005 4:01 pm
by MainSoft
Hi,
isiticov wrote:May be assigning ImageList property at design-time instead of run-time will solve this issue in this case?
This is what I did before. So I tried to assign dynamically. Same problem.
isiticov wrote:Or re-assigning the ImageList in OnChangeLanguage event
Doesn't work either.

This is annoying. Everything worked flawlessly but now I have this ugly menu displayed when switching the language.

Posted: Wed Feb 16, 2005 4:43 pm
by MainSoft
isiticov wrote:Or re-assigning the ImageList in OnChangeLanguage event, like:

Code: Select all

MainMenu1.ImageList := nil;
MainMenu1.ImageList := ImageList1;
OK. problem solved by setting the Images propertry of the main menu to nil before setting the ActiveLanguageProperty and then resetting it afterwards:

mnuMain.Images := nil;
siLangDispatcher.ActiveLanguage := (computed value);
mnuMain.Images := ImageList;

I guess I'm not the only one with this problem so maybe this information belongs to a FAQ.

Thanks for giving me the right direction.

By the way, I also wanted to congratulate for this outstanding product. It is really well thought out. Good job! Just, the help file needs some technical editing and fixes, just to be in sync with the high quality of the software.

--
Patrick Philippot - Microsoft MVP
Consulting Services
www.mainsoft.fr