Main menu gets white background after language switch

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
MainSoft
Posts: 52
Joined: Mon Feb 14, 2005 9:18 am
Contact:

Main menu gets white background after language switch

Post 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.
Patrick Philippot
www.mainsoft.fr
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

May be assigning ImageList property at design-time instead of run-time will solve this issue in this case?
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Or re-assigning the ImageList in OnChangeLanguage event, like:

Code: Select all

MainMenu1.ImageList := nil;
MainMenu1.ImageList := ImageList1;
MainSoft
Posts: 52
Joined: Mon Feb 14, 2005 9:18 am
Contact:

Post 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.
Patrick Philippot
www.mainsoft.fr
MainSoft
Posts: 52
Joined: Mon Feb 14, 2005 9:18 am
Contact:

Post 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
Post Reply