Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Multi Lingual Buttons


Reply
 
Thread Tools Display Modes
  #1  
Old 07-06-2001, 06:05 AM
Panicos
Guest
 
Posts: n/a
Question Multi Lingual Buttons


I am developing an application that dynamically switches from englist to Greek. We store all multilingual Control captions in nn sql database. When we switch from English to Greek, The label.captions, Text.text, tab.captions all work fine.
The commandbutton.caption, option.caption,checkbox.caption do not work.

I have a routine that for each form.control i set the font.name to "arial greek", font.charset to 161, and the caption to the string from the sql table.

Does anybody know, why the command, option, and check box buttons behave differently?

Thank you in advance for your input.


Reply With Quote
  #2  
Old 07-06-2001, 06:12 AM
Laurent Laurent is offline
Senior Contributor

Retired Leader
* Expert *
 
Join Date: Apr 2001
Location: canada, quebec
Posts: 1,334
Default Re: Multi Lingual Buttons

i never tried it myself but are u doing this at runtime or before the form is loaded and shown?

I'll be among the best soon, very soon!!!
__________________
Still tons to learn!
Reply With Quote
  #3  
Old 07-06-2001, 08:24 AM
pponchot
Guest
 
Posts: n/a
Default Re: Multi Lingual Buttons

There's a lot of information that you didn't think to supply such as:

1. What happens when the font is changed - does the command button text change?
2. When I tried it and the font size was too big for the command button, it appeared that nothing was there because I was seeing the space.

Here is a neat trick I learned from being an idiot. Go to the routine where you put change the command button code and put in this code - go to. This will give you a coding error but ignore it. Run the program. When the program bombs out on the "go to" delete it. The program is now in a "debug"mode. Press the F8 button and step through the code. Putting the mouse cursor over the properties will give you the values. This will give you some idea of what is happening and why it is not working.

I have this code for the command button that worked fine:

Private Sub Command1_Click()
Command1.Font = "Greek"
Command1.Font.Bold = False
Command1.Font.Size = 20
Command1.Caption = "Goodbye"
End Sub

The font and size was originally Ariel Black with the size being 10. The text was originally "Hello There". It worked.

Another thing to check is how the code is being brought into the program. Is it a string? Are you sure?

Try this. Put a hidden text box on your form and read the text from the database into the textbox. Then change the caption of the command button to the text in the text box. I have run into problems on how vb defines data if you do not do it (difficult to explain).

P.S. If you do not put the font into "" then the font reverts to one that windows chooses. This could be the problem.

Another trick I learned is just to setup a small test program (like I did above) and checkout what happens.


Hope this helps. Phillip

...And on that day, Lister, Satan will be ice skating to work.... Rimmer, Red Dwarf
Reply With Quote
  #4  
Old 07-06-2001, 09:37 AM
KesleyK's Avatar
KesleyK KesleyK is offline
Senior Contributor

Retired Moderator
* Expert *
 
Join Date: Jun 2001
Location: Idaho, missing Dallas
Posts: 965
Default Re: Multi Lingual Buttons

You can place a breakpoint at your cursor by using <F9>, then you won't have to clear the Err variable...

______
Cheers!
__________________
We shall persevere.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->