473,396 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Change charaterset of textbox winforms

Hi

Is there anyway to change the characterset/codepage of a specific textbox on
a winform.

I have read in a "chinese traditional big5" file into memory using a
streamreader with the appropriate codepage
SR = New StreamReader(TBLFilename,
System.Text.Encoding.GetEncoding(Cube.CodePage))

do I need to change the codepage of the entire form?
--
thank you,

Richard
Nov 21 '05 #1
7 7389
"Richard Bond" <ri**@nospam.nospam> schrieb:
Is there anyway to change the characterset/codepage of a specific textbox
on
a winform.

I have read in a "chinese traditional big5" file into memory using a
streamreader with the appropriate codepage
SR = New StreamReader(TBLFilename,
System.Text.Encoding.GetEncoding(Cube.CodePage))

do I need to change the codepage of the entire form?


..NET Windows Forms controls should be Unicode-aware. Did you try to use a
font that contains the required Unicode characters?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #2
Herfried,

If the textbox has to support all sorts of characters do I have to specify a
font for each language. In which case, how do I choose a font for each
language, and how should I distribute them best (Include each .ttf file and
set it to vsdrpFont in the setup project)?

or specify a font that is "font independent" somehow????

On a seperate note:

I have previously "got away with" changing the response.codepage and
response.charset "properties" on an ASP page to display chinese characters
without having to change the stylesheet from the Arial font. Was this a bit
of luck due to Font Fallback or something different?

Thank you for all your help,

Richard
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:es**************@TK2MSFTNGP10.phx.gbl...
"Richard Bond" <ri**@nospam.nospam> schrieb:
Is there anyway to change the characterset/codepage of a specific textbox on
a winform.

I have read in a "chinese traditional big5" file into memory using a
streamreader with the appropriate codepage
SR = New StreamReader(TBLFilename,
System.Text.Encoding.GetEncoding(Cube.CodePage))

do I need to change the codepage of the entire form?


.NET Windows Forms controls should be Unicode-aware. Did you try to use a
font that contains the required Unicode characters?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3
"Richard Bond" <Ri**********@tnsofres.com> schrieb:
If the textbox has to support all sorts of characters do I have to specify
a
font for each language. In which case, how do I choose a font for each
language, and how should I distribute them best (Include each .ttf file
and
set it to vsdrpFont in the setup project)?


I didn't work much with localization, but I assume that a Chinese Windows
version will include fonts that provide the characters used by your
application so you don't have to care too much about choosing the right
fonts if you are using "standard fonts". Arial Unicode is a font that
contains lots of Unicode characters, but I am not sure if a "localized"
version of this font is installed on Chinese computers.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #4
Thank You,

Arial Unicode MS seems to support my requirements for the moment. Is it
correct to say that it is a font that can represent ~52,000 glyphs and that
the font is global, i.e. no local versions of the font?

I have it as a result of an office 2000 install, but how do I deploy it via
vb.net to someone who doesn't have it? (is the filename: ARIALUNI.TTF) and
are there performance implications of using such a gigantic lookup scheme
(its~100 times larger than normal arial)? + are there licensing
implications?

sorry for the hassle,

Richard
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uS**************@TK2MSFTNGP10.phx.gbl...
"Richard Bond" <Ri**********@tnsofres.com> schrieb:
If the textbox has to support all sorts of characters do I have to specify a
font for each language. In which case, how do I choose a font for each
language, and how should I distribute them best (Include each .ttf file
and
set it to vsdrpFont in the setup project)?


I didn't work much with localization, but I assume that a Chinese Windows
version will include fonts that provide the characters used by your
application so you don't have to care too much about choosing the right
fonts if you are using "standard fonts". Arial Unicode is a font that
contains lots of Unicode characters, but I am not sure if a "localized"
version of this font is installed on Chinese computers.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #5
Hi

The unicode encoding is global, so the font is global, i.e. they are same
on the different machine. While I think to localization a world-ready
program, we need to provide is the customized UI element, e.g. such as
strings, error messages, dialog boxes, menus, and embedded object
resources. But the font should be installed before, usually we did not
deploy the font with the deployment project.

Worldwide Deployment
http://office.microsoft.com/en-us/as...363931033.aspx

Also for license issue, I highly recommend that you call 800-426-9400
(select option 4), Monday through Friday, 6:00 A.M. to 6:00 P.M. to speak
directly to a Microsoft licensing specialist.

Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #6
Hmmm,

I'm getting more and more confused. This a reply to a similar question from
Dr International...... It seems more complicated than using Arial Unicode
MS, so unlesss anyone complains about the app I'll stick to Arial Unicode
MS.

Richard,

The best practice is to always use the higher-level font face name known as
"MS Shell Dlg." MS Shell Dlg is actually not a font. Rather, it is a font
face name that gets mapped to the right font depending on the
font-substitution settings of the operating system. By setting your default
resource font as MS Shell Dlg, you are assured of providing the appropriate
font solution, not only on Windows 2000 and Windows XP, but also on all
versions of Windows since Windows 95!

Hope this helps.
Dr. International
Windows International, Microsoft
Are you world-ready? -- http://www.microsoft.com/globaldev

""Peter Huang" [MSFT]" <v-******@online.microsoft.com> wrote in message
news:FM**************@cpmsftngxa10.phx.gbl...
Hi

The unicode encoding is global, so the font is global, i.e. they are same
on the different machine. While I think to localization a world-ready
program, we need to provide is the customized UI element, e.g. such as
strings, error messages, dialog boxes, menus, and embedded object
resources. But the font should be installed before, usually we did not
deploy the font with the deployment project.

Worldwide Deployment
http://office.microsoft.com/en-us/as...363931033.aspx

Also for license issue, I highly recommend that you call 800-426-9400
(select option 4), Monday through Friday, 6:00 A.M. to 6:00 P.M. to speak
directly to a Microsoft licensing specialist.

Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #7
Hi Richard,

As the document said, the MS Shell Dlg is not a true font, it is a kind of
abstract font, it will be mapping into the really font according to the
locale setting in the system.
For detailed information, you may take a look at the "MS Shell Dlg" in the
msdn.

That is to say, if you wants to display certain font, you still need to
install the true font on the end-users' machine.
So my suggestion is to install the font with the windows or office
installation program. That is to say, you can write a readme to tell the
end-user to install the font. If you do wants to deploy the font, you can
also do that in the deployment project.

For license issue about deploy the font shipped with office , I highly
recommend that you call 800-426-9400
(select option 4), Monday through Friday, 6:00 A.M. to 6:00 P.M. to speak
directly to a Microsoft licensing specialist.

Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Steve | last post by:
Visual Studio 2003 .NET C# I am trying to change the width of a textbox at run time, to fit in the text it contains. How can I do this? Thanks Steve
3
by: Ronald S. Cook | last post by:
Hi all, I have an ASP.NET DataGrid wherein there is an edit link for each row. Upon clicking the link, certan fields in that row display in text boxes so that they may be edited. I would like...
9
by: nail | last post by:
Hi. So I have a default.aspx page and 3 WebUserControls In the WebUserControl1, I have on TexBox, and in the default.aspx page I have a Button control. On the click event of the default.aspx page...
1
by: Joe | last post by:
I have a WinForms user control and I want to change the width using a client script on a when page. Can this be done? I was thinking something along the lines of: function resize() { var o =...
0
by: landesjoe | last post by:
Hi, Here's the problem: We have an app that we open by default for the user logged into the Windows box on a Windows Domain (using active directory). Let's say that's "Hans". That works great,...
1
by: Mark van Dijk | last post by:
Hi there, I have a farely simple question that I can't seem to find the answer to. I've got a C# Winforms application that after building results in an executable. This executable is then...
0
by: marcelo | last post by:
Could you help me out here. I need to accomplish this: I need to filter listbox items from by entering some characters to the textbox. But the problem is that items (files that are read from...
3
by: viral123 | last post by:
Hi all, does any one know how to get the functionality of get focus and lost focus using ASP.Net like VB.Net I want to change the textbox back ground color when it has the focus. I used...
1
by: martin DH | last post by:
Hello, I have a unique situation, I believe. I have a form with unbound textboxes (frmEditReport) - most populate from a search query but one unbound textbox, txt_ReturnInfo, populates based on a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.