473,397 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

richtextbox.Rtf problem vb 2005

2
be soft this is my first post here
I have a problem with the richtextbox.rtf code when I run my program
And move to the next record then move back:

(this is how the data looks before richtextbox.rtf before it changes it):
\pard \fi-360 \li360 \sb80 \sa40 \f2 \cf2 \'e0\'e1\cf0 \f0 (Aramaic)\par \b0 \f3 'ab\cf0 \f0 \par \pard \sa60 \b1 BDB Definition:\b0 \par \pard \fi-360 \li360 \sa60 1) father\par \pard \sb60 \sa60 \b1 Part of Speech:\b0 noun masculine\par \b1 A Related Word by BDB/Strong\rquote s Number:\b0 corresponding to H1\par \b1 Same Word by TWOT Number: \b0 2553\par

(this is how it looks after richtextbox.rtf converts it which just how I want it to look):
אב (Aramaic)
'ab
BDB Definition:
1) father
Part of Speech: noun masculine
A Related Word by BDB/Strong’s Number: corresponding to H1
Same Word by TWOT Number: 2553

(But this is how it look after I move back 1 record or move again to the next record):
?? (Aramaic)'abBDB Definition:1) fatherPart of Speech: noun masculineA Related Word by BDB/Strong’s Number: corresponding to H1Same Word by TWOT Number: 2553

‘Here is the code, at the moment I have put this code in button control, I need to stop it from replying the rtf format if it has already applied it but if haven’t to do so

Expand|Select|Wrap|Line Numbers
  1. Dim s As String
  2.         s = Me.DefinitionRichTextBox.Text
  3.         Me.DefinitionRichTextBox.Rtf = "{\rtf1\ansi\fcharset177" & s
  4.  
Oct 22 '07 #1
4 2038
vanc
211 Expert 100+
be soft this is my first post here
I have a problem with the richtextbox.rtf code when I run my program
And move to the next record then move back:

(this is how the data looks before richtextbox.rtf before it changes it):
\pard \fi-360 \li360 \sb80 \sa40 \f2 \cf2 \'e0\'e1\cf0 \f0 (Aramaic)\par \b0 \f3 'ab\cf0 \f0 \par \pard \sa60 \b1 BDB Definition:\b0 \par \pard \fi-360 \li360 \sa60 1) father\par \pard \sb60 \sa60 \b1 Part of Speech:\b0 noun masculine\par \b1 A Related Word by BDB/Strong\rquote s Number:\b0 corresponding to H1\par \b1 Same Word by TWOT Number: \b0 2553\par

(this is how it looks after richtextbox.rtf converts it which just how I want it to look):
אב (Aramaic)
'ab
BDB Definition:
1) father
Part of Speech: noun masculine
A Related Word by BDB/Strong’s Number: corresponding to H1
Same Word by TWOT Number: 2553

(But this is how it look after I move back 1 record or move again to the next record):
?? (Aramaic)'abBDB Definition:1) fatherPart of Speech: noun masculineA Related Word by BDB/Strong’s Number: corresponding to H1Same Word by TWOT Number: 2553

‘Here is the code, at the moment I have put this code in button control, I need to stop it from replying the rtf format if it has already applied it but if haven’t to do so

Expand|Select|Wrap|Line Numbers
  1. Dim s As String
  2.         s = Me.DefinitionRichTextBox.Text
  3.         Me.DefinitionRichTextBox.Rtf = "{\rtf1\ansi\fcharset177" & s
  4.  
Can you make it a bit clearer what you're trying to achieve here? What is richtextbox.rtf??? Is it RichTextBox Control you're talking about?
Oct 23 '07 #2
nmilne
2
Can you make it a bit clearer what you're trying to achieve here? What is richtextbox.rtf??? Is it RichTextBox Control you're talking about?
sorry if i put my code in the BindingSource_PositionChanged
then press next record the code then reformats the raw data in the richtextbox
to how it should show
the problem is when i press the previous record the code then reply the changes not on the raw data but on the new changed format its allready done
how can i stop it from replying to the allready changed data in the richtextbox
Expand|Select|Wrap|Line Numbers
  1.    Private Sub DictionaryBindingSource_PositionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DictionaryBindingSource.PositionChanged
  2.  
  3.         Dim s As String
  4.         s = Me.DefinitionRichTextBox.Text
  5.         Me.DefinitionRichTextBox.Rtf = "{\rtf1\ansi\fcharset177" & s
  6.  
  7.     End Sub
how can i stop it from replying the format on text that allready been done
Oct 23 '07 #3
vanc
211 Expert 100+
sorry if i put my code in the BindingSource_PositionChanged
then press next record the code then reformats the raw data in the richtextbox
to how it should show
the problem is when i press the previous record the code then reply the changes not on the raw data but on the new changed format its allready done
how can i stop it from replying to the allready changed data in the richtextbox
Expand|Select|Wrap|Line Numbers
  1.    Private Sub DictionaryBindingSource_PositionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DictionaryBindingSource.PositionChanged
  2.  
  3.         Dim s As String
  4.         s = Me.DefinitionRichTextBox.Text
  5.         Me.DefinitionRichTextBox.Rtf = "{\rtf1\ansi\fcharset177" & s
  6.  
  7.     End Sub
how can i stop it from replying the format on text that allready been done
I guess you can put the already applied format text into a variable and when you move back records you can then check for the older record or not to retrieve the old formated text. Because the control have no idea of what you want to do, it just do what you actually ask it to :D.

cheers.
Oct 26 '07 #4
Plater
7,872 Expert 4TB
Is the only difference that the line breaks are removed?
I think it's because while regular textboxes use "\r\n" as a lline break, rtf has it's own symbol and something is lost when you use the .Text property and send it right back with the .rtf property?
Oct 26 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: nouno | last post by:
I am trying to spell check a richtextbox. Through code (shown below) I save the contents of the richtextbox to a rtf file, open the rtf file in Word, spell check it, save it, and then load the ftf...
3
by: kangoo | last post by:
Hi, I'm trying to remove the last charater in a richTextBox. I though richTextBox.Text.Remove(richTextBox.Text.length-1, 1); would work, but it does nothing (eg richTextBox.Text += "some new...
2
by: JonnyT | last post by:
I searched high and low for an answer on how to auto scroll a richtextbox and now I finally have it. Since it took me a while to get a good efficient way of doing it that didn't require focus to...
0
by: ronchese | last post by:
Hello All. I'm using the RichTextBox control to show text to user that can do the primary font formatting: fontname, size, color, bold, italic and underline. Unlike the RichTextBox used in VB...
3
by: Bob | last post by:
I had an app in VB6 that I'm "upgrading" <GGGG> to Vb.net 2005. In Vb6 I had rtf text in a field in a Sql server 2000 field and it would show up as formatted RTF in my richtextbox. In vs.net that...
0
by: Vincent | last post by:
Dear all, I have implemented a class to export the content of RichTextBox to image in WYSISYG mode so that line breaks on the screen are the same as exported. C# Code: public struct...
9
by: James Wong | last post by:
Hi, I use the RichTextBox in my program. It will use different language in this RichTextBox (chinese and english characters), and it set the "DualFont" and use different fonts. By the way, how...
3
by: michael sorens | last post by:
The documentation for the RichTextBox is sketchy at best. I want to do a very simple task but I cannot find information on this. I am using a RichTextBox as an output window. Some text I want to...
0
by: Vimalathithan | last post by:
I just developing a editor. I have provide the options like Bold, Italic, underlin, font change, font size change. These font options are keep in with one toolstripbutton. the toolstripbar keep...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.