Solved

Paste Special Character into TextBox

Posted on 2006-06-14
22
3,804 Views
Last Modified: 2013-12-03
I have a regular vb app and i wanna paste from a document into a textbox for example a Russian letter. I get a ? in the textbox instead.

I know about the RichTextBox but im not changing a 1000 textboxes.

Thanks
0
Comment
Question by:Mikal613
  • 9
  • 9
  • 2
  • +1
22 Comments
 
LVL 8

Accepted Solution

by:
List244 earned 500 total points
ID: 16904240
The problem I would guess is the font setting.  If the character is not in the selected font for the textbox it will not show.
The reason a rich text box would be able to do this, is it can change the font for just one character, a textbox can not.

I would suggest just switching to the rich text box.  You could open the project, press control + T, find Microsoft Rich
Text Box Control, add it, then close the project.

Create a new project with ONLY a module, no form.  Add this code:

Option Explicit
Public Sub Main()
Dim temp() As String
Dim File As String
temp = Split(Command$, """ """)
Dim I As Long
For I = 0 To UBound(temp)
    temp(I) = Replace(temp(I), """", "")
    Open temp(I) For Binary As #1
        File = Space(LOF(1))
        Get #1, , File
    Close #1
    File = Replace(File, "Begin VB.TextBox", "Begin RichTextLib.RichTextBox")
    Open temp(I) For Output As #1
        Print #1, File
    Close #1
Next I
End Sub

Then you can drag your form files to the EXE that creates and it will make all your text boxes RTF boxes.  It however
will not work perfectly.  It can be altered to be better.. but that is a good start.  The main problem with this is that
RTFs store their text in the Form.Frx file, so you will lose any default texts.
0
 
LVL 48

Author Comment

by:Mikal613
ID: 16905020
The font is installed
0
 
LVL 8

Expert Comment

by:List244
ID: 16905119
The font may be installed, but it must be set in the textbox.  A standard textbox may only hold one font at a time.  So unless
it is set to that font, it will be unable to display the character.  The RTF boxes differ from this in the way that they can display
multiple fonts at one time.  This is why it necessary to use another type of textbox.
0
 
LVL 9

Expert Comment

by:Naveen Swamy
ID: 16910703
you want to make an multilingual application,

locale, fonts and charset are all included in this topic
 
0
 
LVL 48

Author Comment

by:Mikal613
ID: 16910716
A textbox can have more than one font. IF you press alt shift it changes fonts with keeping the previous characters.
0
 
LVL 8

Expert Comment

by:List244
ID: 16911867
Mika, which language are you using?  Visual Basic 6?  .NET 2003?  2005?

I have never seen nor heard of this alt+shift for changing fonts.  And in Visual Basic 6, the standard text box
can only hold one font at a time.  Changing a font in a standard text-box changes the font of the entire box.
0
 
LVL 48

Author Comment

by:Mikal613
ID: 16911990
vb6

Yes when you press alt shift it changes the font.
0
 
LVL 8

Expert Comment

by:List244
ID: 16912046
Milka, this does not happen when I press alt + shift.  Which OS are you running?  And like stated previously a change
in font should change the entire box.  This is why you can't paste just one special character, the box does not know
how to display it in the current font-setting.  This is why we have the Rich Text File boxes, so that we may add multiple
fonts colors and settings.
0
 
LVL 48

Author Comment

by:Mikal613
ID: 16912093
open a new project

add a textbox

write some alpha characters
press alt shift
write some alpha characters
press alt shift again
write some alpha characters
press alt shift again
write some alpha characters
press alt shift again

and youll see the font change
0
 
LVL 8

Expert Comment

by:List244
ID: 16912116
Again, this does not do anything for me.  Which OS are you running?
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 8

Expert Comment

by:List244
ID: 16912120
Can you post a screenshot somewhere to show what you see?
0
 
LVL 48

Author Comment

by:Mikal613
ID: 16912138
here is my regular font руку шы ьн туц ащте вщ нщг дшлу ше,,,

Like that exactly
0
 
LVL 48

Author Comment

by:Mikal613
ID: 16912379
woooo thats amazing when i wrote it it looked differntly.

It seems the EE database is using varchar and not nvarchar because it converted my string.
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 16925066
you need to add unicode support  to your textboxes(google it) and ensure that their default font is the one that displays those characters.
0
 
LVL 48

Author Comment

by:Mikal613
ID: 17292089
im waiting for something that i can actually use.

Sorry dan im gonna send this to CS
0
 
LVL 8

Expert Comment

by:List244
ID: 17292099
Mika, again, why not use a Rich Text Box?  I am telling you the standard box only supports one font.
0
 
LVL 48

Author Comment

by:Mikal613
ID: 17292119
"I know about the RichTextBox but im not changing a 1000 textboxes."
0
 
LVL 8

Expert Comment

by:List244
ID: 17292133
I gave you code that would allow you to make an EXE that would allow FRM files to be dragged into it for
running, and it would fix them for you.
0
 
LVL 48

Author Comment

by:Mikal613
ID: 17292393
im not gonna rely on that. I have 1800 clients
0
 
LVL 8

Expert Comment

by:List244
ID: 17292401
Heh, 1800 clients, thousands of textboxes, and rather than try, you just let the months pass by.  No offense, but you could have
been done by now.
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 17293806
its not as hard to change text boxes (to richtext) as you think:
open a vbp file in notepad and use the find/replace function
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now