Click here to Skip to main content
15,891,431 members
Home / Discussions / C#
   

C#

 
GeneralRe: [Message Deleted] Pin
Paul Conrad3-Sep-07 7:52
professionalPaul Conrad3-Sep-07 7:52 
GeneralRe: [Message Deleted] Pin
Colin Angus Mackay3-Sep-07 8:06
Colin Angus Mackay3-Sep-07 8:06 
GeneralRe: [Message Deleted] Pin
Paul Conrad3-Sep-07 8:25
professionalPaul Conrad3-Sep-07 8:25 
QuestionNeed code for Word Wrapping- Plz help Pin
Hum Dum3-Sep-07 2:12
Hum Dum3-Sep-07 2:12 
AnswerRe: Need code for Word Wrapping- Plz help Pin
Luc Pattyn3-Sep-07 5:15
sitebuilderLuc Pattyn3-Sep-07 5:15 
GeneralRe: Need code for Word Wrapping- Plz help Pin
Hum Dum4-Sep-07 19:05
Hum Dum4-Sep-07 19:05 
GeneralRe: Need code for Word Wrapping- Plz help Pin
Luc Pattyn5-Sep-07 8:50
sitebuilderLuc Pattyn5-Sep-07 8:50 
GeneralNo where to go........- Plz help Pin
Hum Dum18-Sep-07 19:12
Hum Dum18-Sep-07 19:12 
With all respect sir plz,

The thing is its a very small firm in which i m working, & have no senior to help. on my own i tried every possible way,
All is fine(Acc. to me), only the editing or modifying the text creates problem.

if user enter 3-4 lines:
"This is trial message plz ignore.
This is trial message plz ignore.
This is trial message plz ignore.
This is trial message plz ignore."

and now when user comes back to first line and enter some data in between, then the problem starts,

plz sir Cry | :((





private void txtBody_TextChanged(object sender, System.EventArgs e)
		{
			#region "wrap"     
			string[] tempArray = new string [txtBody.Lines.Length];       	
			tempArray = txtBody.Lines;        
			
			int PrevSel = txtBody.SelectionStart;       
			string Op = "";      
			
			//No. of chracter user can specify
			int maxLength = Convert.ToInt32(textBox1.Text);       	
			bool change= false;       
			
			for(int cou = 0; cou < tempArray.Length ; cou++)
			{        
				if (tempArray[cou].Length > maxLength)         	
				{           
					string[] words = tempArray[cou].Split(' ');
					int currentLineLength = 0;           
					string currentLine = "";            
					foreach(string currentWord in words)
					{            
						if(currentWord.Length >= 0)            
						{               
							if(currentWord.Length >= maxLength)              
							{               
								Op += currentWord.Insert(maxLength, "\r\n");
								break;               
							}            
							if(currentLineLength + currentWord.Length + 1 < maxLength)
							{                
								currentLine += currentWord + " ";
								currentLineLength += currentWord.Length +1;

							}            
							else             
							{               
								Op +=currentLine.Insert(currentLineLength, "\r\n");
								currentLine = currentWord + " ";   
								currentLineLength = currentWord.Length;
							}
						}
					}         
					if(currentLine !="") 
						Op += currentLine;

					PrevSel++;           
					change = true;      
				}
				else
				{ 
					Op += tempArray[cou] + "\r\n";
				}
				if(change)
				{
					txtBody.Text = Op;
					txtBody.SelectionStart = PrevSel;
				}
			}
			#endregion
			
		}

AnswerRe: TRICKY&CHALLENGING LOOP Pin
Pete O'Hanlon3-Sep-07 2:12
mvePete O'Hanlon3-Sep-07 2:12 
QuestionConersion to DateTime Data type from String Pin
Prashant C3-Sep-07 2:02
Prashant C3-Sep-07 2:02 
AnswerRe: Conersion to DateTime Data type from String Pin
darkcalin3-Sep-07 4:06
darkcalin3-Sep-07 4:06 
QuestionI'm lost while looping! Pin
Muammar©3-Sep-07 1:46
Muammar©3-Sep-07 1:46 
AnswerRe: I'm lost while looping! Pin
Pete O'Hanlon3-Sep-07 2:00
mvePete O'Hanlon3-Sep-07 2:00 
GeneralRe: I'm lost while looping! Pin
Muammar©3-Sep-07 2:15
Muammar©3-Sep-07 2:15 
GeneralRe: I'm lost while looping! Pin
Pete O'Hanlon3-Sep-07 2:23
mvePete O'Hanlon3-Sep-07 2:23 
QuestionUsing gSOAP with C# Pin
Zahid Ajaib3-Sep-07 1:14
Zahid Ajaib3-Sep-07 1:14 
QuestionCABing UnCABing... Pin
Bhavesh Bagadiya3-Sep-07 0:35
Bhavesh Bagadiya3-Sep-07 0:35 
AnswerRe: CABing UnCABing... Pin
Bhavesh Bagadiya3-Sep-07 2:35
Bhavesh Bagadiya3-Sep-07 2:35 
GeneralRe: CABing UnCABing... Pin
Vasudevan Deepak Kumar3-Sep-07 2:39
Vasudevan Deepak Kumar3-Sep-07 2:39 
QuestionIs Crystal Report is not come with .Net Framework? Pin
Kumar Arun3-Sep-07 0:25
Kumar Arun3-Sep-07 0:25 
AnswerRe: Is Crystal Report is not come with .Net Framework? Pin
J4amieC3-Sep-07 0:39
J4amieC3-Sep-07 0:39 
GeneralRe: Is Crystal Report is not come with .Net Framework? Pin
Vasudevan Deepak Kumar3-Sep-07 1:34
Vasudevan Deepak Kumar3-Sep-07 1:34 
QuestionParsing XML from a string Pin
Anders Molin3-Sep-07 0:00
professionalAnders Molin3-Sep-07 0:00 
AnswerRe: Parsing XML from a string Pin
Sandeep Akhare3-Sep-07 0:08
Sandeep Akhare3-Sep-07 0:08 
AnswerRe: Parsing XML from a string Pin
J4amieC3-Sep-07 0:36
J4amieC3-Sep-07 0:36 

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.