PC Review Forums Newsgroups Microsoft DotNet Microsoft VB .NET Bug in Rich Text Box control tab setting array?

Reply

Bug in Rich Text Box control tab setting array?

 
Thread Tools Rate Thread
Old 03-11-2003, 06:28 PM   #1
Jim Haynes
Guest
 
Posts: n/a
Default Bug in Rich Text Box control tab setting array?


I cannot set the tab array for the Rich Text Box
control. After I have text in the control, I try the
following where rtb is the name of the rich text box
control:

rtb.selectall()
Redim rtb.SelectionTabs(5) 'to set 5 tabs
rtb.SelectionTabs(0) = 100 'pixels
rtb.SelectionTabs(1) = 200 'etc
....
This has no effect on the selected text. Further I can
immediatly read the contents of the SelectionTabs() array
and all value remain zero. I have struggled for about 2
weeks with every permutation of code and Rtb setting I
can dream up and have not found a way to set the tabs.
The previous VB6 Rich text box control worked fine. Is
this a new bug?



  Reply With Quote
Old 03-11-2003, 07:05 PM   #2
Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
Default Re: Bug in Rich Text Box control tab setting array?

* "Jim Haynes" <anonymous@discussions.microsoft.com> scripsit:
> I cannot set the tab array for the Rich Text Box
> control. After I have text in the control, I try the
> following where rtb is the name of the rich text box
> control:
>
> rtb.selectall()
> Redim rtb.SelectionTabs(5) 'to set 5 tabs
> rtb.SelectionTabs(0) = 100 'pixels
> rtb.SelectionTabs(1) = 200 'etc
> ...
> This has no effect on the selected text. Further I can
> immediatly read the contents of the SelectionTabs() array
> and all value remain zero. I have struggled for about 2
> weeks with every permutation of code and Rtb setting I
> can dream up and have not found a way to set the tabs.
> The previous VB6 Rich text box control worked fine. Is
> this a new bug?


This code works fine for me (VS.NET 2003):

\\\
With Me.RichTextBox1
.SelectAll()
.SelectionTabs = New Integer() {100, 300, 400}
End With
///

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
  Reply With Quote
Old 03-11-2003, 08:39 PM   #3
Guest
 
Posts: n/a
Default Re: Bug in Rich Text Box control tab setting array?

Thanks,

That works fine for me on VB.net 2002 as well.
Apparently it was a matter of understanding when I
actually have a "New" instance of the selectionTabs()
array.

>-----Original Message-----
>* "Jim Haynes" <anonymous@discussions.microsoft.com>

scripsit:
>> I cannot set the tab array for the Rich Text Box
>> control. After I have text in the control, I try the
>> following where rtb is the name of the rich text box
>> control:
>>
>> rtb.selectall()
>> Redim rtb.SelectionTabs(5) 'to set 5 tabs
>> rtb.SelectionTabs(0) = 100 'pixels
>> rtb.SelectionTabs(1) = 200 'etc
>> ...
>> This has no effect on the selected text. Further I

can
>> immediatly read the contents of the SelectionTabs()

array
>> and all value remain zero. I have struggled for about

2
>> weeks with every permutation of code and Rtb setting I
>> can dream up and have not found a way to set the

tabs.
>> The previous VB6 Rich text box control worked fine. Is
>> this a new bug?

>
>This code works fine for me (VS.NET 2003):
>
>\\\
>With Me.RichTextBox1
> .SelectAll()
> .SelectionTabs = New Integer() {100, 300, 400}
>End With
>///
>
>--
>Herfried K. Wagner
>MVP · VB Classic, VB.NET
><http://www.mvps.org/dotnet>
>
><http://www.plig.net/nnq/nquote.html>
>.
>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off