Re: problem handling backspace key

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Dan Bass (danielbass)
Date: 12/03/04


Date: Fri, 3 Dec 2004 13:54:01 -0000

RTF -> Html ...

I found this

    http://www.codeguru.com/Cpp/controls/richedit/conversions/article.php/c5377/

not sure if he has pictures though.

Good luck.

"NuBBeR" <bennnyandlinds@hotmail.com> wrote in message
news:uujOh8H2EHA.1860@TK2MSFTNGP15.phx.gbl...
> Dan you dont know how much i appreciate your help!
> As for building the html after the user is done i could do that but the
> problem is is i am allowing the user to place images into the rtb. what i
> was doing was using rtbHiddent.Text += "<img src='"+dlgOpen.FileName+"'>";
> to insert the image tag. If i were to place the html tags in afterwards
> there isnt any filename or hints of where the image is from in rtf. i.e.-
> the rtf coding for an image is something like
> "{\pict{.....}02352464F20000000235234210003246023.....}"
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnrtfspec/html/rtfspec.asp
> has more info on the rtf syntax. So the solution would work except for the
> fact that somehow i would have to track the image filenames and the
> position they are to be at. Thank you so much for the help Dan!
>
> "Dan Bass" <danielbass [at] postmaster [dot] co [dot] uk> wrote in message
> news:%235XHikH2EHA.3616@TK2MSFTNGP11.phx.gbl...
>> This depends on how much data they're entering in... If you're not
>> expecting them to enter all that much (less that a couple of thousand
>> characters say), then the solution is a little easier.
>>
>> if the original text is something like:
>>
>> "Hello World!"
>>
>> and you then do this in your second text box
>>
>> "<html>
>> <head><title>New Text</title></head>
>> <body>
>> <p>Hello World!</p>
>> </body>
>> </html>"
>>
>>
>> The easiest way would definately NOT be to track each key press and alter
>> the second text box one at a time... If I press the left cursor seven
>> times and then typed "Blue Skied ", you'd expect the resulting text to be
>> "Hello Blue Skied World!" not "Hello World!Blue Skied". I presume this is
>> where your problems are coming in with backspaces and delete presses...
>>
>> What I would suggest is to simply generate the text in the new text box
>> once the user has finished typing what they need to (if this is an
>> option) or, if you MUST, on each key press... You could do this by doing
>> the following:
>>
>> StringBuilder sb = new StringBuilder ();
>> sb.Append ( "<html>\r\n" );
>> sb.Append ( "<head><title>New Text</title></head>\r\n" );
>> sb.Append ( <body>\r\n" );
>> sb.Append ( "<p>" );
>> sb.Append ( firstTextbox.Text );
>> sb.Append ( "</p>\r\n" );
>> sb.Append ( "</body>\r\n" );
>> sb.Append ( "</html>" );
>> textboxSecond.Text = sb.ToString();
>>
>> Let me know if you need any more help.
>>
>> Dan.
>>
>>
>>
>>
>> "C#" <bennnyandlinds@hotmail.com> wrote in message
>> news:%23Vf2VZ91EHA.1400@TK2MSFTNGP11.phx.gbl...
>>>I have a richtextbox that i am copying to an invisible richtextbox .
>>>during the keydown and keypress events i am inserting HTML tags into the
>>>invisble richtextbox along with the origional text. The only problem i
>>>am running into is when the user presses the backspace and delete key i
>>>have a hard time knowing how to erase the charater(s) desired from the
>>>invisible richtextbox because it contains additional text. Any help is
>>>GREATLY appreciated. Thanks in advance!
>>>
>>
>>
>
>



Relevant Pages

  • Re: problem handling backspace key
    ... As for building the html after the user is done i could do that but the ... there isnt any filename or hints of where the image is from in rtf. ... Thank you so much for the help Dan! ... >>I have a richtextbox that i am copying to an invisible richtextbox. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Images rotated 180 degrees
    ... Can you save in RTF or maybe in HTML. ... Windows XP Pro SP2 ...
    (microsoft.public.mac.office.word)
  • To convert RTF to HTML using GNU GPL-licenced component
    ... that converts RTF to HTML? ... Thanks, Dan ... Prev by Date: ...
    (comp.lang.java.gui)
  • Re: XML and DOM through MFC?
    ... DOM is a really poor document mechanism, and in general it is very, very limited in what ... HTML and RTF are sort-of-unrelated; both deal with formatting and layout (while XML deals ... specified in a document available from Microsoft, and most new Office products and other ...
    (microsoft.public.vc.mfc)
  • Re: Submit form and if($Submit){ problem, please help...
    ... Persoonlijk zeg ik zulke dingen dan liever privé dan ze over straat te ... maar je hebt geen mail-adres dat werkt. ... Je maakt ten onrechte gebruik van HTML berichten voor nieuwsgroepen. ... Als je een vraag hebt, kijk eens onder Google, en dan GROUPS, ...
    (alt.php)