Hello again

I'm dealing with a problem in VB6

I have the swedish version in the national enverionment as default
and the LabelDatum.Caption = StrConv(Format$(MyDate, "dddd dd mmmm yyyy"), vbProperCase)
is saying SÖNDAG in the first form but I will change that with some code
in the form2 that the label are going too say SUNDAY

is't possible to do that?????

many thanks in advance


Recommended Answers

All 7 Replies

Requirement is not clear.

Requirement is not clear.

Hello again

I have one form labeld = Swedishform

and number two labeld = Englishform

When I go from Swedishform to Englishform then the
national enverioment shall become the ENGLISH verioment.

(Swedish line

LabelDatum.Caption = StrConv(Format$(MyDate, "dddd dd mmmm yyyy"), vbProperCase)

is saying the Swedish word SÖNDAG )

But the same string at the englishform should be like this

LabelDateng.Caption = StrConv(Format$(MyDate, "dddd dd mmmm yyyy"), vbProperCase)

and saying the english word SUNDAY

Thanks in advanced


You can use Weekday(DateSerial(Year, Month, Day)) grab the output and convert it from Sunday to Saturday.

You should use the International Friendly functions supplied with VB6. This must be a classroom assignment. You're not the first to post here about how to do this.

Look up the following phrase in yous MSDN documentation: "Writing International Code in Visual Basic"

But never use a string value for a date. Use the date format: #8/2/97# And you should get used to using the resource editor which is designed and supplied by Microsoft to deal with International issues:

Use the LoadResString(ByVal TagID as Long) as String function to load different values based on the locale your user has set in the Control Panel for his country. Your program will then detect the user's system's locale and use the appropriate Resource String based on the country settings of the operating system.

You'll need to load the Resource Editor Addin in your IDE. And then you need to one string table for each country you wish to support. And then when your program loads, use the LoadResString function to load the correct string value: e.g. Label1.Caption = LoadResString(cLng(Label1.Tag)) .


No I don't whant that solution I have tried it but when you are sitting
with the enviroment as default Say Swedish i'ts okej
in sweden when the user change to English form Then the
Form should be in ENGLISH and the enviroment shall be ENGLISH
enviroment and when you goes back to the swedish form
then the eviroment shall be the default as the computers national enviroment.

You can still use the LoadResString function. It does not have to be used just when the user changes his locale.

But you'll just have to add more items in the resource table.


LoadResString(128) for Swedish.
LoadResString(256) for English

And you'll have to some method for the user to toggle his preference. And then you need to write code to change the captions or pictures or whatever it is that you want to change.

You can write a private function in your form to accomplish the same:

Private Sub LoadResourceStrings(ByVal CountryID as Long) 

' Enter code here to change captions based on CountryID

End Sub

Thanks for al Help

Many Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.