From: Leo on
How should I go about implementing a togleable WordWrap feature (like
notepad) for a multiline textbox in my application.

--
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Free usenet access at http://www.eternal-september.org


From: Dee Earley on
On 07/06/2010 11:27, Leo wrote:
> How should I go about implementing a togleable WordWrap feature (like
> notepad) for a multiline textbox in my application.

You have two textboxes and change between them as needed.
This is essentially what notepad does (it recreates the window with the
changed style)

--
Dee Earley (dee.earley(a)icode.co.uk)
i-Catcher Development Team

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)
From: Larry Serflaten on

"Leo" <ttdhead(a)gmail.com> wrote
> How should I go about implementing a togleable WordWrap feature (like
> notepad) for a multiline textbox in my application.

Hide one textbox behind another (move them both when resizing). Set
word wrap on one of them and use Z-Order to determine which one is
in front. Keep text only in the front textbox to minimize memory use.

EX:

Sub WWToggle(WWrap As Boolean)
Dim txt As String
txt = Text1.Text & Text2.Text
If WWrap Then
Text2.ZOrder 0
Text1.Text = ""
Text2.Text = txt
Else
Text1.ZOrder 0
Text2.Text = ""
Text1.Text = txt
End If
End Sub


LFS




From: Leo on
Larry Serflaten formulated the question :
> "Leo" <ttdhead(a)gmail.com> wrote
>> How should I go about implementing a togleable WordWrap feature (like
>> notepad) for a multiline textbox in my application.
>
> Hide one textbox behind another (move them both when resizing). Set
> word wrap on one of them and use Z-Order to determine which one is
> in front. Keep text only in the front textbox to minimize memory use.
>
> EX:
>
> Sub WWToggle(WWrap As Boolean)
> Dim txt As String
> txt = Text1.Text & Text2.Text
> If WWrap Then
> Text2.ZOrder 0
> Text1.Text = ""
> Text2.Text = txt
> Else
> Text1.ZOrder 0
> Text2.Text = ""
> Text1.Text = txt
> End If
> End Sub
>
>
> LFS

Should I use two seperate text boxes or two that are together in a
control array

--
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Free usenet access at http://www.eternal-september.org


From: Dee Earley on
On 07/06/2010 14:22, Leo wrote:
> Larry Serflaten formulated the question :
>> "Leo" <ttdhead(a)gmail.com> wrote
>>> How should I go about implementing a togleable WordWrap feature (like
>>> notepad) for a multiline textbox in my application.
>>
>> Hide one textbox behind another (move them both when resizing). Set
>> word wrap on one of them and use Z-Order to determine which one is
>> in front. Keep text only in the front textbox to minimize memory use.
>
> Should I use two seperate text boxes or two that are together in a
> control array

That is entirely up to you and your coding style

--
Dee Earley (dee.earley(a)icode.co.uk)
i-Catcher Development Team

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)
 | 
Pages: 1
Prev: Newsreader Mayhem!
Next: RunAsService struggling