473,732 Members | 2,204 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying semi graphic caracters

Hi,

I'm looking for a way to display semi graphic characters in a multi line
text control or in a rich text control.
I've tried with all the characters of the extended ASCII table (code page
437), they appear correctly except the semi graphic ones.

Please help ...

Thanks a lot
David
Nov 20 '05 #1
2 3698
These are known as "glyph characters". They are not in ASCII (certainly not
in the misnamed "extended ASCII") as they are only a part of a single OEM
code page. The only way to get them to display:

1) Have the text in cp437.

2) PInvoke to MultiByteToWide Char, with a CodePage of 437 and a dwFlags of
MB_USEGLYPHCHAR S.

3) You the resultant string in your display.
--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.
"David Scemama" <da***********@ wanadoo.fr> wrote in message
news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
Hi,

I'm looking for a way to display semi graphic characters in a multi line
text control or in a rich text control.
I've tried with all the characters of the extended ASCII table (code page
437), they appear correctly except the semi graphic ones.

Please help ...

Thanks a lot
David

Nov 20 '05 #2
Hello, David:

I suggest you use System.Drawing to draw boxes because most of the fonts don't support the graphic characters, some support them through char sets (like Microsoft Sans Serif) and few support it directly (like Arial)

You can learn how to use codepages in the internationaliz ation documentation.

Anyway, here is an example. Create a form with a button and two textboxes. Set the Font property of TextBox1 to Arial and of TextBox2 to Microsoft Sans Serif. Leave the Font.GDICharSet property at the default value of zero for both TextBoxes. Past this code:

Private Sub Button1_Click(B yVal sender As System.Object, _
ByVal e As System.EventArg s) Handles Button2.Click
'We need encoding for working with codepages:
Dim enc As System.Text.Enc oding = System.Text.Enc oding.GetEncodi ng(437)

'TextBox1 uses Arial font.
'TextBox2 was assigned Microsoft Sans Serif with GDICharSet=0 at design time.
'TextBox1 is OK, but we must correct the font for TextBox2:
Me.TextBox2.Fon t = New Font(Me.TextBox 2.Font.FontFami ly, _
Me.TextBox2.Fon t.SizeInPoints, _
Me.TextBox2.Fon t.Style, _
GraphicsUnit.Po int, _
255)
'Now the fonts are ready and both TextBoxes display correctly:
'We set from unicode (ChrW),
' from codepage 437 (enc.GetString)
' and inline ("┼═║" ) (keyboard: Alt+2501, Alt+2509, Alt+2490).
Me.TextBox1.Tex t = ChrW(&H255E) & ChrW(&H256A) & ChrW(&H256C) & ChrW(&H2563) _
& enc.GetString(N ew Byte() {32, &HC6, &HD8, &HCE, &HB9}) _
& " ─│┌┐└ ┘├┤┬┴ ┼═║╒╓ ╔╕╖╗╘ ╙╚╛╜╝ ╞╟*╡╢ ╣╤╥╦╧ ╨╩╪╫╬ ▀▄█▌▐ ░▒▓"
Me.TextBox2.Tex t = ChrW(&H255E) & ChrW(&H256A) & ChrW(&H256C) & ChrW(&H2563) _
& enc.GetString(N ew Byte() {32, &HC6, &HD8, &HCE, &HB9}) _
& " ─│┌┐└ ┘├┤┬┴ ┼═║╒╓ ╔╕╖╗╘ ╙╚╛╜╝ ╞╟*╡╢ ╣╤╥╦╧ ╨╩╪╫╬ ▀▄█▌▐ ░▒▓"
End Sub

Now, if you delete the "Me.TextBox2.Fo nt = ..." statement, you will see that TextBox2 displays only empty boxes.
Of course, you can set Font.GDICharSet to 255 at design time.

You can use the charmap to see the codes corresponding to the graphic characters and if a font of your system supports them.

Note that this message has been coded with UTF-8 in order to keep the graphic characters. When you use special characters inline, you must save the code file (*.vb) encoding it, for example, with UTF-8, or other coding that supports the special characters.

Note also that Windows 98 and Me TextBoxes are not fully compatible with Unicode and "┼═║" might be displayed as "+-|"

Regards.
"David Scemama" <da***********@ wanadoo.fr> escribió en el mensaje news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
| Hi,
|
| I'm looking for a way to display semi graphic characters in a multi line
| text control or in a rich text control.
| I've tried with all the characters of the extended ASCII table (code page
| 437), they appear correctly except the semi graphic ones.
|
| Please help ...
|
| Thanks a lot
| David

Nov 20 '05 #3

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

Similar topics

2
1921
by: Steven | last post by:
Hi there, I have a list of values that I am displaying in a table (Not using a loop) I want to be able to put a graphic next to the item with the hightest price. I have all of the prices in a table. Any ideas?
0
1761
by: api | last post by:
I'm using XSL stylesheets and XML documents to generate PDF files with xsltproc, then fop. The problem is, I can't get images to show up in the PDF (the text showing up in the fo file, though). I've tried the following: <fo:external-graphic src="url(/path/to/image.jpg)" /> <img src="http://path/to/image.jpg" content-height=".2in"
0
1595
by: David | last post by:
I am using CGI.pm and GD to make a page that generates a diagram based on some form input. The problem I have is under IE (Netscape seems to work correctly) the new graphic that is generated is not displayed when the user clicks the submit button and a new page is delivered. However, if you click the refresh button in the toolbar - it does. This indicates to me that the JPEG is actually created on the server, but the browser is displaying...
3
3481
by: Dalan | last post by:
At first I was not certain what could cause Access 97 from displaying most jpeg images, but not all. After further testing, it seemed that all original images of less than 275 pixels per inch or less would display, but those close to 300 pixels/inch or greater would not (MS Access cannot recognize the file format xxx.jpg). The larger, original images were scanned and saved as .bmp (at 300 dpi producing a 15MB file). Then the images were...
13
3609
by: Aladdin | last post by:
I have an MS Access form on which I have a listbox listing tables in that database. I want to be able to click on any of those tables and view its contents on the same form using subforms or any grid control. I tried many grid controls (DBGrid, DataGrid, MSFlexGrid), the ADO Data Control and everything I can think of, with no success. Here are the contraints I faced: (1) Populating any of the grid controls manually is too slow for my...
2
9803
by: pei_world | last post by:
Hi I want to create a image with multiple layers on top. the background color of each layer should be transparent except the last one, hence I can only see the drawed items on such layers. can anyone tell me whether or not C# allow to do this? pei_world
2
5189
by: alain.hogue | last post by:
I have a table "tblCards" with a field "Titre" that contain french words (Hbert, Gagn, Hlne, etc....) in an database with SQLEXPRESS 2005. I have used the asp:SqlDataSource to filter the SELECT statement according to a Textbox the user can type into. When used with the LIKE condition using any acute caracters the SELECT statement return nothing, unless the acute caracters is replaced with an ampersand "%". Even the underscore "_"...
0
1282
by: anjachow | last post by:
The system generated email that are automatically sent displaying well in any web-based mail systems (yahoo, msn, etc...). The foreign characters (vowels with accents and the ) aren't displaying correctly. The foreign caracters do display correctly in OUTLOOK however. pliza is coming as póliza this is the code <?xml version="1.0"?> <!DOCTYPE xsl:stylesheet <!ENTITY nbsp "*">]> <xsl:stylesheet...
1
1952
by: natural | last post by:
Good Day. I am currently via Form send data to a word template.. I have about 150 bookmarks in a word document which was previously imported via a simular document. and appended into my DB. The data changes etc we export it back for various reasons. I use the following Code: --------------------------------------------------------------------------------
0
8946
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9447
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
9307
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...
1
9235
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9181
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
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 projectplanning, coding, testing, and deploymentwithout 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
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
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.