Link to home
Start Free TrialLog in
Avatar of victorlong
victorlong

asked on

DrawText and Pound sign

How to put the English Pound sign in the text box and how to use DrawText to draw it on the form?
Avatar of victorlong
victorlong

ASKER

Edited text of question
Hello Vic.....

What does the pound sign looks like..????????

to draw it on the formmmm use something like this....

Why not use the TextOut() Api since it's easier to use......

you need to use the GetDC() and ReleaseDC() API also...

Dim DC as Long
Dim T as LongBool 'Do you have LongBool in VB??? If not find something to be used...

DC = GetDC(Me.hWnd)
T = TextOut(DC, 100, 100, "Hello", 5)
DC = ReleaseDC(Me.hWnd, DC)

That would output it on the form at x : 100 and y : 100 ........

To display a character for the pound you need to give me what that character looks like...
for example this would display the © character.... if your font is set to Times

EditBox1.Text = $Chr(0169)

I hope this help a little, but I ain't VB programmer so I don't know many of the functions that VB uses.....

If you need some more help I'd try to help you/...

//Vik
Oh I think this function goes like this Chr$(0169) instead of $Chr(0169) sorry for that....

//Vik
ASKER CERTIFIED SOLUTION
Avatar of Grdv
Grdv

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Experts

Thank you very much.

I can see the "£" on my keyboard. Whenever need a "#" I just press it and every thing is fine. Now I need a "£" in my code but no way to put it to the code.

I will try chr$(163) and hope it can work in both of the textbox and the function DrawText.

Cheers
Thanks to  viktornet also.
No problem.....Just remmember that the code for the character depends on the font you are using.... If you are using different font, the code for the pound character might be different, so you need to set the font to some font that you know exactly what the value is for a pound sign...

/./Viktor