Click here to Skip to main content
15,924,901 members
Home / Discussions / C#
   

C#

 
GeneralRe: Beginner C# homework project - stuck Pin
Ennis Ray Lynch, Jr.26-Jan-10 10:29
Ennis Ray Lynch, Jr.26-Jan-10 10:29 
GeneralRe: Beginner C# homework project - stuck Pin
Luc Pattyn26-Jan-10 13:51
sitebuilderLuc Pattyn26-Jan-10 13:51 
QuestionHow to display image in crystal report? Pin
mahdi136726-Jan-10 7:27
mahdi136726-Jan-10 7:27 
QuestionTroubles with a DPI Aware application Pin
Antonino Porcino26-Jan-10 6:50
Antonino Porcino26-Jan-10 6:50 
AnswerRe: Troubles with a DPI Aware application Pin
Ciumac Sergiu26-Jan-10 7:10
Ciumac Sergiu26-Jan-10 7:10 
QuestionBIZTALK questions: do not import duplicate data coming from csv file to sql server table Pin
challa_praveena26-Jan-10 6:46
challa_praveena26-Jan-10 6:46 
AnswerRe: BIZTALK questions: do not import duplicate data coming from csv file to sql server table Pin
PIEBALDconsult26-Jan-10 7:11
mvePIEBALDconsult26-Jan-10 7:11 
Questionsending output to a multiline text box. Pin
CodeRed300026-Jan-10 5:11
CodeRed300026-Jan-10 5:11 
Form has two multiline text boxes and one button. I am using a foreach loop to read each word in a input textbox and put the output for each word in a textbox called outputtextbox.text and append some text to it. The program works perfectly, except the output in the output textbox only gives me the last word from the input textbox. I set a breakpoint on the foreach and stepped through the code and I can see that each word is being read. However, the output is only displaying one word, the last word. Ie) (This is not real code)inputtextbox = bears cats dogs and user hits the submit button, only dogs with the appended text will be displayed. It's as if the output textbox is being overwritten. Can anyone please give me any pointers to display all the words on seperate lines in an output multiline textbox. Thank you so much. I would really apprecaiate the help.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace ForEachTester
{
public partial class ForEachForm : Form
{
public ForEachForm()
{
InitializeComponent();
}

string sentence = "";
string SingleWordHolder = "";

private void Submitbutton_Click(object sender, EventArgs e)
{

sentence = InputtextBox.Text;

foreach (string word in sentence.Split())
{

SingleWordHolder = word;

//supposed to append text and output each word on
//on a seperate line in the output multiline text box.
OutputtextBox.Text = ("abo" + SingleWordHolder + "nvo");
}


}
}

CodeRed

AnswerRe: sending output to a multiline text box. Pin
Rob Philpott26-Jan-10 5:20
Rob Philpott26-Jan-10 5:20 
AnswerRe: sending output to a multiline text box. Pin
OriginalGriff26-Jan-10 5:26
mveOriginalGriff26-Jan-10 5:26 
AnswerRe: sending output to a multiline text box. Pin
Luc Pattyn26-Jan-10 6:15
sitebuilderLuc Pattyn26-Jan-10 6:15 
Questionvery fast image conversion from jpg to bmp in c# Pin
Mohammad Mahdipour26-Jan-10 3:32
Mohammad Mahdipour26-Jan-10 3:32 
AnswerRe: very fast image conversion from jpg to bmp in c# Pin
Natza Mitzi26-Jan-10 3:46
Natza Mitzi26-Jan-10 3:46 
GeneralRe: very fast image conversion from jpg to bmp in c# Pin
harold aptroot26-Jan-10 3:50
harold aptroot26-Jan-10 3:50 
GeneralRe: very fast image conversion from jpg to bmp in c# Pin
Natza Mitzi26-Jan-10 4:58
Natza Mitzi26-Jan-10 4:58 
GeneralRe: very fast image conversion from jpg to bmp in c# Pin
harold aptroot26-Jan-10 5:30
harold aptroot26-Jan-10 5:30 
GeneralRe: very fast image conversion from jpg to bmp in c# Pin
Natza Mitzi26-Jan-10 8:13
Natza Mitzi26-Jan-10 8:13 
GeneralRe: very fast image conversion from jpg to bmp in c# Pin
harold aptroot26-Jan-10 8:19
harold aptroot26-Jan-10 8:19 
AnswerRe: very fast image conversion from jpg to bmp in c# Pin
Luc Pattyn26-Jan-10 4:05
sitebuilderLuc Pattyn26-Jan-10 4:05 
GeneralRe: very fast image conversion from jpg to bmp in c# Pin
Mohammad Mahdipour26-Jan-10 18:31
Mohammad Mahdipour26-Jan-10 18:31 
GeneralRe: very fast image conversion from jpg to bmp in c# Pin
Luc Pattyn27-Jan-10 12:47
sitebuilderLuc Pattyn27-Jan-10 12:47 
AnswerRe: very fast image conversion from jpg to bmp in c# [modified] Pin
The Zetta26-Jan-10 6:07
The Zetta26-Jan-10 6:07 
GeneralRe: very fast image conversion from jpg to bmp in c# Pin
Ennis Ray Lynch, Jr.26-Jan-10 10:48
Ennis Ray Lynch, Jr.26-Jan-10 10:48 
GeneralRe: very fast image conversion from jpg to bmp in c# Pin
The Zetta27-Jan-10 5:30
The Zetta27-Jan-10 5:30 
AnswerRe: very fast image conversion from jpg to bmp in c# Pin
Mohammad Mahdipour26-Jan-10 18:37
Mohammad Mahdipour26-Jan-10 18:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.