realbasic-nug
[Top] [All Lists]

Re: HowTo center editfield text for Win98

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: HowTo center editfield text for Win98
From: Dan Knauf <rb at eknauf dot com>
Date: Fri, 30 Sep 2005 02:13:56 -0700
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <433C72E2 dot 3050209 at eknauf dot com> <f72ec0cb0509291825t709790dp4943793d7d39fe15 at mail dot gmail dot com>
Thanks Paul.  I'll give that a try.

 Dan



Paul Rehill wrote:
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?
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>