Results 1 to 7 of 7

Thread: How to write URDU on Picture Box

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    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

  2. #2
    PowerPoster
    Join Date
    Sep 2006
    Location
    Egypt
    Posts
    2,579

    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



  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    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

  4. #4
    PowerPoster
    Join Date
    Sep 2006
    Location
    Egypt
    Posts
    2,579

    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.



  5. #5
    Fanatic Member DrUnicode's Avatar
    Join Date
    Mar 2008
    Location
    Natal, Brazil
    Posts
    631

    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:
    Attached Images Attached Images  
    Attached Files Attached Files

  6. #6
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: How to write URDU on Picture Box

    Picture1.Print Text1.Text use this

  7. #7
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    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 ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width