New topic: The real textsize in an editfield
<http://forums.realsoftware.com/viewtopic.php?t=29697> Page 1 of 1 [ 9 posts ] Previous topic | Next topic Author Message forisco Post subject: The real textsize in an editfieldPosted: Sun Aug 23, 2009 10:55 am Joined: Thu Feb 07, 2008 2:21 pm Posts: 183 Location: Italy How to obtain the real font size in an editfield with textsize setted to 0 (the default size for the current O.S.) ? In Windows, for my O.S., is 12. _________________ RealBasic 2009 Release 1 Standard Edition on Windows Vista SP2 and on Windows 7 Beta 7000 Database Engine : ADODB (Microsoft Access MDB) - Report Engine : RPDF Top pony Post subject: Re: The real textsize in an editfieldPosted: Sun Aug 23, 2009 11:39 am Joined: Sat Nov 11, 2006 2:43 pm Posts: 194 Location: DFW area, Texas, USA search is your friend viewtopic.php?p=160176#p160176 Top DaveS Post subject: Re: The real textsize in an editfieldPosted: Sun Aug 23, 2009 11:57 am Joined: Sun Aug 05, 2007 10:46 am Posts: 1463 Location: San Diego, CA Code: FUNCTION strWidth(caption As String) As Double if caption="" then Return 0 Dim tmp As Picture Dim result As Integer tmp=NewPicture(2,2,32) // Use what ever size and Font you editfield has tmp.graphics.TextSize=13 tmp.graphics.TextFont="System" result=tmp.Graphics.StringWidth(caption) tmp=nil Return result END FUNCTION _________________ Dave Sisemore MacPro, RB2008r3.1 Top forisco Post subject: Re: The real textsize in an editfieldPosted: Sun Aug 23, 2009 12:39 pm Joined: Thu Feb 07, 2008 2:21 pm Posts: 183 Location: Italy The pony's answer is correct, but that complication! Thank you!!! Bye _________________ RealBasic 2009 Release 1 Standard Edition on Windows Vista SP2 and on Windows 7 Beta 7000 Database Engine : ADODB (Microsoft Access MDB) - Report Engine : RPDF Top DaveS Post subject: Re: The real textsize in an editfieldPosted: Sun Aug 23, 2009 1:00 pm Joined: Sun Aug 05, 2007 10:46 am Posts: 1463 Location: San Diego, CA All righty then..... guess he didn't really want an answer afterall _________________ Dave Sisemore MacPro, RB2008r3.1 Top forisco Post subject: Re: The real textsize in an editfieldPosted: Sun Aug 23, 2009 1:54 pm Joined: Thu Feb 07, 2008 2:21 pm Posts: 183 Location: Italy dave, a simple property (e.g. RealFontSize) is most convenient for me. I use RB2009r.1 because the TextField control have the alignment bug. I'm waiting for the next release. _________________ RealBasic 2009 Release 1 Standard Edition on Windows Vista SP2 and on Windows 7 Beta 7000 Database Engine : ADODB (Microsoft Access MDB) - Report Engine : RPDF Top DaveS Post subject: Re: The real textsize in an editfieldPosted: Sun Aug 23, 2009 1:59 pm Joined: Sun Aug 05, 2007 10:46 am Posts: 1463 Location: San Diego, CA yeah.... built in functions for EVERYTHING would be great..... but it doesn't exist.... So you either go without.... or you add your own functions...... after all isn't that what being a developer is all about? _________________ Dave Sisemore MacPro, RB2008r3.1 Top forisco Post subject: Re: The real textsize in an editfieldPosted: Sun Aug 23, 2009 2:21 pm Joined: Thu Feb 07, 2008 2:21 pm Posts: 183 Location: Italy Mea culpa, Dave, mea culpa! You are right! In your opinion, what is the best method for my problem? _________________ RealBasic 2009 Release 1 Standard Edition on Windows Vista SP2 and on Windows 7 Beta 7000 Database Engine : ADODB (Microsoft Access MDB) - Report Engine : RPDF Top DaveS Post subject: Re: The real textsize in an editfieldPosted: Sun Aug 23, 2009 2:29 pm Joined: Sun Aug 05, 2007 10:46 am Posts: 1463 Location: San Diego, CA my solution is above _________________ Dave Sisemore MacPro, RB2008r3.1 Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 9 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
