Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Greek letters in a label 1

Status
Not open for further replies.

BirdieNamNam

Programmer
Feb 12, 2004
52
0
0
SE
Hello dear friends!

I have a delta ([Δ]) letter, that I want to display at a label, surrounded by "normal" letters. The only way I can find to do this is to make three labels, the first with my first "normal" text, the second with the delta letter, and finally the last one with the rest of the "normal" letters.

In that case I can set the font for the second label to Symbol, where the delta sig is.

Is there really no way to make this display in one label. I have a lot of these situation, and the design is not looking too well when connecting labels.

Best regards, Sebastian.
 
Perhaps using a rich text box with the border property set to false. Load the textbox at run time.
 
Hi Matt!

Ok, I looked into the rich text box, but to me that seems to work in the same way as the ordinary text box. It has a font property, and I cannot set that to multiple fonts, can I? Or am i missing something here? Can you tell me what to write to the rich text box, to display "My [Δ] is fantastic!".

Best regards, Sebastian.
 
Hey There.
There is no other way of doing this to my knowlagde.

I do this all the time to.

Is this a Static label or do the values in the first and second labels change as the program changes?

if it keeps changing then you :

Say the labels are named label1 label2 and label3.
Label2 has the delta sign

to make the delta sign always appear in between the other 2 labels but look like it is all one label do the following:

Label2.left = Label1.left + label1.width + 100
Label3.Left = Label2.Left + label2.Width + 100
Label2.Top = label1.Top
Label3.Top = label2.Top


The + 100 at the far left of the code is like a space you place between the labels to form a "normal" space in the text. If the Label's text size increases then so should that + 100. Experiment with the + 100 at the left to Achive the correct size.



If it doesn't keep changing ( it always stays the same ) :

Then just design the form with the labels placed in the correct places.
 
This can be done with the rich text box. If you look into the character map under the

Start>Programs>Accessories>System Tools folder

you can copy the character to the clipboard and paste it to the rich text box during runtime. You would use the rtb not changing the font at all. Labels have a way of jumping around when installed on different machines with different settings, even if programatically placed. I will post the code shortly to use the rtb

Matt
 
Great Matt!

And I created some code that will make some greek characters:

Code:
RichTextBox1.SelFontName = "Arial"
RichTextBox1.TextRTF = "Kalle D"
RichTextBox1.SelStart = 6
RichTextBox1.SelLength = 1
RichTextBox1.SelFontName = "Symbol"
RichTextBox1.SelLength = 0

But here comes my next problem. When I want to print this I get the RichTextBox1.TextRTF to spool to the printer, but it does not contain the font formatting, of course. Any suggestions?

Thanks a lot for your efforts!

/Sebastian.
 
Are you printing the form or are you printing just the text in the rtf. if you are printing the text then my preference has always been to export to MS Word to handle the printing. It is easier than the hassle of the printer object. There are a few good threads on exporting to word in this forum. As for printing the form (as your initial post was creating a label) I am not sure why the symbol wouldn't show up, as it is just graphics at this point...

Thanks for the star.

Matt
 
Thanks a lot Matt, I do not really know what I want to print. The Word export idea seems like an interesting one. I will continue laborating and exploring. The star is for anyone that helps me lot on my road to VB perfection. Thanks!

/Sebastian.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top