473,662 Members | 2,637 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2952
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.N ullChar'. 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.N ullChar'. 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.N ullChar'. 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******** ********@TK2MSF TNGP12.phx.gbl. ..
* "Sandra Setz" <ss************ *@wxs.nl> scripsit:
You can use 'InStr' or the string's 'IndexOf' method to search for
'ControlChars.N ullChar'. 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
278
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 just don't want to ensure the validity of it's value. Since you can't inherit from string, what would be the best way to approach this? Mike
2
2140
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 string I know how to do with a class: typeof(MyNamespace1.Drawing.Class1).FullName --> I get the string for my class path
9
7125
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 when I tried the program on the Win98 system it will be running on, I get the following error: Cast from string "2076719" to type 'Long' is not valid I am not sure why I only get this error on the Win98 system or how to go about correcting...
7
1573
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 generate a datagrid with 2 columns. One column would have the actual name of the property, and the other would have the value of the property. So, if I have a property called "User_Name" with a value of "Bill" I would want it to show up in the...
3
2759
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 ReadOnly Property Mandatory() As String End Class I the derived class I cannot override the property Mandatory because the return types differ:
2
1937
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 part of the Text he likes, but when typing new chars, always add them on a new last line (-at the end of the Text) ) Thanks, Udi.
19
2620
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I access a property of an object using a string? ----------------------------------------------------------------------- There are two equivalent ways to access properties: the dot notation and the square bracket notation. What you are looking for is the square bracket notation in which the dot, and the identifier to its right, are replaced with a...
7
2372
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. This might be a little hairy, but I'll try to keep it short. Situation: I want to pass a string to a function which will parse it and generate objects in a list.
5
1487
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 Client.FirstName ? Chris
0
8345
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8857
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8768
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
8547
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
8633
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...
1
6186
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
4181
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...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
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

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.