How to get the length of a Text in mips or pixels

Discussion in 'Questions (Windows Mobile)' started by berndgoedecke, Jan 10, 2008.

  1. berndgoedecke

    berndgoedecke Active Member Licensed User

    Dear B4P users and developers,
    is it possible to get the textlength in mips or pixel?
    I searched the forum and the help files, but found no function to get this information, that will help to format a text box depending on the length of the text.

    Best regards

    bernd goedecke
     
  2. willisgt

    willisgt Active Member Licensed User

    Check out the imageLib. It has two functions - StringWidth and StringHeight - that will provide the information you need.

    It helps to provide a little extra room when sizing your control to the text it contains. My experience is that the imagelib functions return values that are just slightly too small for the purposes of calculating control width and height.

    Gary
     
Loading...