Click here to Skip to main content
15,915,319 members
Home / Discussions / C#
   

C#

 
GeneralRe: foreach loop with controls Pin
Judah Gabriel Himango1-Feb-05 9:11
sponsorJudah Gabriel Himango1-Feb-05 9:11 
GeneralRe: foreach loop with controls Pin
Dwayner791-Feb-05 9:30
Dwayner791-Feb-05 9:30 
GeneralRe: foreach loop with controls Pin
Robert Rohde1-Feb-05 9:49
Robert Rohde1-Feb-05 9:49 
GeneralINdividual Character format in Richtext Pin
Vodstok1-Feb-05 8:07
Vodstok1-Feb-05 8:07 
GeneralRe: INdividual Character format in Richtext Pin
Robert Rohde1-Feb-05 9:07
Robert Rohde1-Feb-05 9:07 
GeneralRe: INdividual Character format in Richtext Pin
Heath Stewart1-Feb-05 10:08
protectorHeath Stewart1-Feb-05 10:08 
GeneralRe: INdividual Character format in Richtext Pin
Vodstok1-Feb-05 10:27
Vodstok1-Feb-05 10:27 
GeneralRe: INdividual Character format in Richtext Pin
Heath Stewart1-Feb-05 10:36
protectorHeath Stewart1-Feb-05 10:36 
Wow, that is the most grotesque use of switch I've ever seen. Use a simple if statement to make your code more readable. Someone sustaining code like that I'm sure would hold a grudge.
if (thrower.SelectionFont.Bold)
{
  b == 1;
}
else
{
  b = 2;
}
How you set these variables depends greatly on your algorithm. Every time you change the selection you must reset your variables, like b, i, and u. As you're writing your text check the value of each one to determine if you need to write them. Writing HTML like the following is completely valid:
<b><u>bold and underlined text</u></b>
You might consider - depending on your requirements - one of many RTF to HTML converters, which you can search[^] for, or click "Search comments" directly above this forum to see the many discussions we've had about this before.

The method you're using now is pretty restrictive and won't handy much of what RTF can do. If your RTF documents are expected to be simple, however, your approach may be fine. Many of the RTF to HTML converters are, however, pretty inexpensive.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralRe: INdividual Character format in Richtext Pin
Heath Stewart1-Feb-05 10:39
protectorHeath Stewart1-Feb-05 10:39 
Questionhow to change the ProcessWindowStyle of a running process Pin
IsaacB1-Feb-05 7:31
IsaacB1-Feb-05 7:31 
AnswerRe: how to change the ProcessWindowStyle of a running process Pin
Dave Kreskowiak1-Feb-05 8:36
mveDave Kreskowiak1-Feb-05 8:36 
GeneralRe: how to change the ProcessWindowStyle of a running process Pin
Alex Korchemniy1-Feb-05 8:38
Alex Korchemniy1-Feb-05 8:38 
AnswerRe: how to change the ProcessWindowStyle of a running process Pin
Alex Korchemniy1-Feb-05 8:37
Alex Korchemniy1-Feb-05 8:37 
GeneralRe: how to change the ProcessWindowStyle of a running process Pin
IsaacB1-Feb-05 10:33
IsaacB1-Feb-05 10:33 
GeneralRe: how to change the ProcessWindowStyle of a running process Pin
Dave Kreskowiak1-Feb-05 12:04
mveDave Kreskowiak1-Feb-05 12:04 
GeneralRe: how to change the ProcessWindowStyle of a running process Pin
IsaacB1-Feb-05 12:34
IsaacB1-Feb-05 12:34 
GeneralRe: how to change the ProcessWindowStyle of a running process Pin
Dave Kreskowiak1-Feb-05 17:33
mveDave Kreskowiak1-Feb-05 17:33 
Generalubject : programming with .NET Framework to browsing my bank account, buy and sell stock shares Pin
Close Network1-Feb-05 5:56
Close Network1-Feb-05 5:56 
GeneralRe: ubject : programming with .NET Framework to browsing my bank account, buy and sell stock shares Pin
Charlie Williams1-Feb-05 6:05
Charlie Williams1-Feb-05 6:05 
GeneralFire Events on Windows Border Pin
de9me1-Feb-05 4:54
de9me1-Feb-05 4:54 
GeneralRe: Fire Events on Windows Border Pin
Judah Gabriel Himango1-Feb-05 9:13
sponsorJudah Gabriel Himango1-Feb-05 9:13 
GeneralRe: Fire Events on Windows Border Pin
Heath Stewart1-Feb-05 9:53
protectorHeath Stewart1-Feb-05 9:53 
GeneralRe: Fire Events on Windows Border Pin
Judah Gabriel Himango1-Feb-05 10:09
sponsorJudah Gabriel Himango1-Feb-05 10:09 
GeneralRe: Fire Events on Windows Border Pin
Heath Stewart1-Feb-05 10:28
protectorHeath Stewart1-Feb-05 10:28 
GeneralRe: Fire Events on Windows Border Pin
Judah Gabriel Himango1-Feb-05 11:09
sponsorJudah Gabriel Himango1-Feb-05 11:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.