Resolved Replacing a multiline textbox with an initial value

tonycrew

Well-known member
Joined
Apr 20, 2009
Messages
55
Programming Experience
Beginner
We want to Replace some text from a textbox (multiline) with = the text in our combobox and we want to replace it with its new one (in a textbox)

heres our code
VB.NET:
Expand Collapse Copy
If TextBox7.Text.Contains(ComboBox1.Text) Then
                TextBox7.Text.Replace(ComboBox1.Text, TextBox1.Text)
End If

so that says, If the textbox(multiline) contains whats in our combobox, then replace it with the text in textbox1..

but its not working..?
 
VB.NET:
Expand Collapse Copy
If TextBox7.Text.Contains(ComboBox1.Text) Then
      [B]TextBox7.Text = [/B]TextBox7.Text.Replace(ComboBox1.Text, TextBox1.Text)
End If
 
thanks mate!

but could you now help me here..?

i have

VB.NET:
Expand Collapse Copy
            If TextBox7.Text.Contains(ComboBox1.Text) Then
                TextBox7.Text = TextBox7.Text.Replace(ComboBox1.Text, TextBox1.Text)
            End If
            If TextBox7.Text.Contains(ComboBox2.Text) Then
                TextBox7.Text = TextBox7.Text.Replace(ComboBox2.Text, TextBox2.Text)
            End If

and it only works for replacing the first one, im trying to replace multiple peices with the new textbox

and then, it saves that (all of it) to a multiline and saves that to an xml, then reloads that into the multiline one but does not updates the second one, and although it is different in the xml, as the textbox1 saves as the game name and the textbox 2 is saved as description.. take a look!

VB.NET:
Expand Collapse Copy
<menu>
	<game name="3 Ninjas Kick Back (USA)">
		<description>3 Ninjas Kick Back</description>
		<cloneof></cloneof>
		<crc>e5a24999</crc>
		<manufacturer>Malibu</manufacturer>
		<year>1994</year>
		<genre>Action/Platformer</genre>
	</game>
</menu>
 
Last edited:
Back
Top