473,804 Members | 3,182 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

richtextbox.Rtf problem vb 2005

2 New Member
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 2061
vanc
211 Recognized Expert New Member
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 New Member
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_P ositionChanged
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 Recognized Expert New Member
sorry if i put my code in the BindingSource_P ositionChanged
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 Recognized Expert Expert
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
3253
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 file back into the ricktextbox using loadfile. The problem is that the richtextbox seems to remain bound to the rtf file. If I make a change in the richtextbox after spell checking, the changes are successfully saved to the database but if the...
3
21177
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 text"; works) Thanks for your attention & solutions
2
17389
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 the control or the scrolltocaret method I decided that it would be worth posting to anyone who might have similar concerns. For the record this works well in an environment where you cannot have focus going to the richtextbox....such as a chat...
0
1258
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 6, this control in .NET do not apply the expected formatting when there are multiple selection of different font formats. For example, if I select a text that have portions in Bold and other portion
3
5039
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 no longer works, the RTF in the table shows up as unformatted RTF, just as if it were simple ASCII characters. How do I get this functionality back? Thanks again Microsoft! Its great to know you continue making products that are backwards...
0
11162
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 STRUCT_RECT
9
4881
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 can I print out this content to printer easily? Thanks! James
3
7192
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 just add plain (e.g.. rtf.Text += "new stuff..."; ) but some text, when added, I want to be in a different color or font size. Find() will not work because the text will vary. I have delimiters on it so I could recognize it with a regular ...
0
2061
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 inside with panel. The RichTextBox keep inside with other panel. The panel height and width is same with RichTextBox. The RichTextBox both scrolling options are make it as false. I done the coding for RichTextBox's height to fit with...
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10325
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10315
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10075
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9140
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.