473,398 Members | 2,404 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,398 software developers and data experts.

add string at end of rtf property of RichEditBox

Hi,

Can someone explain to me why it isn't possible to add strings after the rtf
property of a RichEditBox? For example, I am trying to create an SQL string
as
follows:

Dim sSQL As String = "UPDATE tblRecipe SET Preparation='" &
txtPreparation.Rtf & "' WHERE Id=35"

For some reason, the text after the Rtf property is not added to the string
sSQL. What is it I am doing wrong? Is there another way I can build this
query?

Thanks in advance,
Sandra
Nov 20 '05 #1
8 2941
Hi,

Use txtPreparation.Text instead.

Ken
-----------------
"Sandra Setz" <ss*************@wxs.nl> wrote in message
news:bt**********@reader08.wxs.nl...
Hi,

Can someone explain to me why it isn't possible to add strings after the
rtf
property of a RichEditBox? For example, I am trying to create an SQL
string
as
follows:

Dim sSQL As String = "UPDATE tblRecipe SET Preparation='" &
txtPreparation.Rtf & "' WHERE Id=35"

For some reason, the text after the Rtf property is not added to the
string
sSQL. What is it I am doing wrong? Is there another way I can build this
query?

Thanks in advance,
Sandra

Nov 20 '05 #2
* "Sandra Setz" <ss*************@wxs.nl> scripsit:
Can someone explain to me why it isn't possible to add strings after the rtf
property of a RichEditBox? For example, I am trying to create an SQL string
as
follows:

Dim sSQL As String = "UPDATE tblRecipe SET Preparation='" &
txtPreparation.Rtf & "' WHERE Id=35"
Are you sure you are not looking for the 'Text' property?
For some reason, the text after the Rtf property is not added to the string
sSQL. What is it I am doing wrong? Is there another way I can build this
query?


Maybe the string contained in the 'Rtf' property ends with a null
character. When appending the text, the IDE and/or message box and/or
some controls won't show the whole string because they think it ends at
the null character.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
> > Can someone explain to me why it isn't possible to add strings after the
rtf
property of a RichEditBox? For example, I am trying to create an SQL string as
follows:

Dim sSQL As String = "UPDATE tblRecipe SET Preparation='" &
txtPreparation.Rtf & "' WHERE Id=35"
Are you sure you are not looking for the 'Text' property?


No, since I want to save the rtf-format into the database as well, so I need
the rtf property.
Maybe the string contained in the 'Rtf' property ends with a null
character. When appending the text, the IDE and/or message box and/or
some controls won't show the whole string because they think it ends at
the null character.


Mmm, how do I check this?

Sandra
Nov 20 '05 #4
> Use txtPreparation.Text instead.

But then I don't save the rtf-formatting, and that's what I want.

Sandra
Nov 20 '05 #5
* "Sandra Setz" <ss*************@wxs.nl> scripsit:
Maybe the string contained in the 'Rtf' property ends with a null
character. When appending the text, the IDE and/or message box and/or
some controls won't show the whole string because they think it ends at
the null character.


Mmm, how do I check this?


You can use 'InStr' or the string's 'IndexOf' method to search for
'ControlChars.NullChar'. If it's part of the string, you can use 'Mid'
or the string's 'Substring' method to get the part of the string without
the null character. After getting rid of this character (if it is part
of the string), concatenate the other string to the end.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #6
> You can use 'InStr' or the string's 'IndexOf' method to search for
'ControlChars.NullChar'. If it's part of the string, you can use 'Mid'
or the string's 'Substring' method to get the part of the string without
the null character. After getting rid of this character (if it is part
of the string), concatenate the other string to the end.


Yeah, this was the problem. Thanks. It seems to work now.

Sandra
Nov 20 '05 #7
* "Sandra Setz" <ss*************@wxs.nl> scripsit:
You can use 'InStr' or the string's 'IndexOf' method to search for
'ControlChars.NullChar'. If it's part of the string, you can use 'Mid' [...]

Yeah, this was the problem. Thanks. It seems to work now.


Thanks for confirming that!

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #8
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
* "Sandra Setz" <ss*************@wxs.nl> scripsit:
You can use 'InStr' or the string's 'IndexOf' method to search for
'ControlChars.NullChar'. If it's part of the string, you can use 'Mid'
[...] Yeah, this was the problem. Thanks. It seems to work now.


Thanks for confirming that!


You're welcome ;-)

Sandra
Nov 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mike | last post by:
Hello, I would like to write a string-like class that will only allow certain string values, (for example, specified with a regular expression). I'd still like it to behave like a string, I...
2
by: Noulouk | last post by:
Hi , I need a string which is the path of a property in my class. For example, my property path is : MyNamespace1.Drawing.Class1.Property1 (found with intellisense) --> I need to put this to a...
9
by: rsine | last post by:
I have developed a program that sends a command through the serial port to our business system and then reads from the buffer looking for a number. Everything worked great on my WinXP system, but...
7
by: JohnR | last post by:
I have a user defined class that contains about 20 private variables with their associated properties and get-sets. I have named the properties with very user readable names. I would like to...
3
by: Philip Wagenaar | last post by:
I created a Mustinherit class with two must override readonly properties: Public MustInherit Class RequestPart Public MustOverride ReadOnly Property Description() As Boolean Public MustOverride...
2
by: Udi | last post by:
Hi, How do I make sure that any character that is typed into my RichEditBox will be appanded to the Text? (I'm using the RichEdit as a console window. I'd like to allow the user selecting any...
19
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I access a property of an object using a string?...
7
by: Donn Ingle | last post by:
Hi, I really hope someone can help me -- I'm stuck. I have written three versions of code over a week and still can't get past this problem, it's blocking my path to getting other code written. ...
5
by: chrisbarber1 | last post by:
Can anyone help?? How can i get the string representation of a property? For example if I have a Client object that has a FirstName property, how in code can I get "FirstName" from...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
0
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...

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.