How to write URDU on Picture Box
I want to write URDU on Picture Box. I can write English on Picture Box using PictureBox.Print property. Please find the below code too.
Code:
Public Sub PrintToCenter(Msg As String, PicBox As PictureBox, FormTop As Boolean)
With PicBox
.AutoRedraw = -1
.Font = "Courier New"
.FontSize = 14
.FontBold = True
.ForeColor = vbWhite
HalfWidth = .TextWidth(Msg) / 2 ' Calculate one-half width.
HalfHeight = .TextHeight(Msg) / 2 ' Calculate one-half height.
.CurrentX = .ScaleWidth / 2 - HalfWidth ' Set X.
.CurrentY = .ScaleHeight / 2 - HalfHeight ' Set Y.
End With
PicBox.Print Msg ' Print message.
End Sub
Re: How to write URDU on Picture Box
If you can write URDU in TextBox then there is no problem to write URDU in Picture box.
If you cannot write URDU in TextBox then the solution in this topic post #12
Re: How to write URDU on Picture Box
I can write Urdu in TextBox using Unicode and MS Form 2.0. All controls of MS Forms 2.0 can support Unicode. But Picture Box control is not available in MS Forms 2.0
Re: How to write URDU on Picture Box
Add Text1 to the form, type some URDU and call PrintToCenter Text1.Text, Picture1, False, it should work.
2 Attachment(s)
Re: How to write URDU on Picture Box
Here is how to do it without having to change Locale to URDU which requires reboot.
You can borrow the hDc of the PictureBox and use DrawTextW to draw Unicode thus bypassing the ANSI limitation of Picture.Print Function.
Sample code in Zip below:
Re: How to write URDU on Picture Box
Picture1.Print Text1.Text use this
Re: How to write URDU on Picture Box
Can you somehow convert your Urdu text to an image, and then 'print' that image into the Picturebox ?