RichTextBox

S

Sanjay

hi,

In VB6 we usedt to have property called selBold,selItalic etc on
RichTextBox.In .NET , we no longer have such properties . Setting SelBold
etc to true/false did all our work.

How can we achieve such in .NET.Main problems occur we want to format text
of mixed fontStyles.
for example,Some part of selection are Bold , then Italic then
Underlined+Italic and nowI want to bold them all.
Obviously , there is no single step to achieve this in .net.
So,Do I am required to traverse each character of the selection and change
their fontStyle ? that will consume a lot of time..

please give me some insight on the same.

I will be thankful if anybody please provides me with some information on
how to achieve the same.

sanjay singh
 
S

Sanjay

hi Richard,

It does not work as any full-fledged RichTextBox will.
And sunce I have upgraded my project from VB6 to VB.net , I want to provide
all the features I used to provide in VB6.
Your RichTextBox does not work for mixed Selection..I am taking an example..

In my selection I have two words "Sanjay" and "Singh".
"Sanjay" is BOLD , "Singh" is BOLD as well as ITALIC.
Now I select all and press "I" to make them all italic.
It does make them but their boldness are not preserved making then normal.
It was not so in VB6 , When we said RichTextBox1.SetBold = true, Selection
was made bold preserving their previous fontStyle.

So obviously it does not serve my purpose.
I want to achieve the same.
Plz provide me with some help

sanjay
 
R

Richard Parsons via DotNetMonster.com

The only work around for this that I can think of right now is to take the
selected string and get the start char and lenght then select manually
select each individual character and bold it.

I know that isn't the best solution but I think it will work. Sorry I
can't be of any more help.

-Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top