473,656 Members | 2,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(TB LFilename,
System.Text.Enc oding.GetEncodi ng(Cube.CodePag e))

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

Richard
Nov 21 '05 #1
7 7418
"Richard Bond" <ri**@nospam.no spam> 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(TB LFilename,
System.Text.Enc oding.GetEncodi ng(Cube.CodePag e))

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.codepa ge and
response.charse t "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******** ******@TK2MSFTN GP10.phx.gbl...
"Richard Bond" <ri**@nospam.no spam> 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(TB LFilename,
System.Text.Enc oding.GetEncodi ng(Cube.CodePag e))

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**********@t nsofres.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******** ******@TK2MSFTN GP10.phx.gbl...
"Richard Bond" <Ri**********@t nsofres.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.m icrosoft.com> wrote in message
news:FM******** ******@cpmsftng xa10.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
13351
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
9459
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 some textboxes to be wider, some narrower. By default, they are all the same pre-defined width. Does anyone know how I can do this? Thanks very much,
9
2118
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 I need to change the TextBox.Text value, but not user the FindControl Method because I think this methos very slow. So, I want this, but not with findcontrol:
1
1291
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 = document.myobject; o.Width = 800; }
0
1191
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, the .NET app uses that user's identity in the Tread.Prinicipal object all through the system, including logging into a SQL2K db where the tables and stored procs use the Windows Account for authorization regarding execute permissions. Now there...
1
2212
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 renamed to an .scr file and used as a Screen Saver. How can I get this file to come up with a different name than the
0
2769
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 directory) in the listbox has the same name in the beginning, for example '2007_<docNo>_<CustomerName_ItemSold>.doc'. And the information I need to find is in the middle of a item name. How do I filter from anywhere (not from the same beginning) in the...
3
11495
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 javascript to change the backgorund color when it has focus but how can I change the background color again when it lost the focus my code is as below
1
2280
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 selection the user chooses when logging in (code below). Basically, the user selects their office at login and the textbox will populate with the appropriate return mailing address when frmEditReport opens. I think this is most efficient since...
0
8296
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8710
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7310
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4299
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1598
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.