Hi Dan
I had problems centering and bolding text in an editfield in Windows 98. It
was a read only editfield though so I supplied the text information to it
and used the BoldEdit method below to center align or bold any text. I found
that I needed to use EndOfLine for carriage returns in code instead of
Chr(13) and that the SearchStr should not include carriage returns in it to
bold and center text from Windows 98 throught to XP.
Sub BoldEdit(SearchStr As String, bCenter As Boolean=False)
Dim e As Integer
e=Instr(1, EditField1.Text, SearchStr)
If e>0 Then
EditField1.SelStart=e-1
EditField1.SelLength=Len(SearchStr)
EditField1.SelBold=True
If bCenter Then
EditField1.SelAlignment=2
End If
End If
End Sub
HTH
Regards
Paul Rehill
mathsteacher.com.au <http://mathsteacher.com.au>
RB 5.5.5 Mac Pro, Mac OS 10.3.6
RB 5.5.5 Win Standard, Win XP SP2
Plugins used: MBS
RealBasic resources: RB Developer, Matt Neuburg's RB book
On 9/30/05, Dan Knauf <rb at eknauf dot com> wrote:
Hello,
I'm using r3 on WindowsXP developing an app that is used on both Windows
98 and WindowsXP. For some reason setting the alignment property only
affects the runtime appearance of an editfield on XP. On Win98 the text
is always aligned to the left.
Setting the alignment property at runtime doesn't work either.
Is there a known workaround for this?