Click here to Skip to main content
15,900,644 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to CAB and UNCAB files using C# Pin
Vasudevan Deepak Kumar3-Sep-07 2:53
Vasudevan Deepak Kumar3-Sep-07 2:53 
GeneralRe: How to CAB and UNCAB files using C# Pin
Pete O'Hanlon3-Sep-07 2:55
mvePete O'Hanlon3-Sep-07 2:55 
GeneralRe: How to CAB and UNCAB files using C# Pin
Vasudevan Deepak Kumar3-Sep-07 5:00
Vasudevan Deepak Kumar3-Sep-07 5:00 
Questionof pesrSessions Pin
Tsepoz3-Sep-07 2:28
Tsepoz3-Sep-07 2:28 
AnswerRe: of pesrSessions Pin
darkcalin3-Sep-07 3:55
darkcalin3-Sep-07 3:55 
QuestionHow to 'lock' the mdiparent border? Pin
shai sherman3-Sep-07 2:27
shai sherman3-Sep-07 2:27 
Question[Message Deleted] Pin
dianenacario3-Sep-07 2:23
dianenacario3-Sep-07 2:23 
AnswerRe: TRICKY AND CHALLENGING LOOP Pin
Pete O'Hanlon3-Sep-07 2:24
mvePete O'Hanlon3-Sep-07 2:24 
AnswerRe: TRICKY AND CHALLENGING LOOP Pin
Colin Angus Mackay3-Sep-07 2:47
Colin Angus Mackay3-Sep-07 2:47 
GeneralRe: TRICKY AND CHALLENGING LOOP.. Pin
Colin Angus Mackay3-Sep-07 2:59
Colin Angus Mackay3-Sep-07 2:59 
GeneralRe: TRICKY AND CHALLENGING LOOP.. Pin
Christian Graus3-Sep-07 3:21
protectorChristian Graus3-Sep-07 3:21 
GeneralRe: TRICKY AND CHALLENGING LOOP.. Pin
Paul Conrad3-Sep-07 7:49
professionalPaul Conrad3-Sep-07 7:49 
AnswerURGENT!!! HOMEWORK!!! Pin
J4amieC3-Sep-07 2:58
J4amieC3-Sep-07 2:58 
AnswerRe: [Message Deleted] Pin
Colin Angus Mackay3-Sep-07 3:58
Colin Angus Mackay3-Sep-07 3:58 
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 
The code is working but with some problem?
If user inputs some lines and come back to previous line, like editing the text, then problem occurs like its overwriting.
Ex line:"1. This Code is giving me much problem as i m fresher."
like this user enter 3-4 lines or paragraph?

Now if user comes back to 1 line and edit, its messed up like:
"1. This code hai s giving me much problem as i m fresher."

Here i try to enter have after code.
Plz help.

private void txtBody_TextChanged(object sender, eventArgs e)
{


if(tbWordwrap.Pushed) 
   {       
	string[] tempArray = new string(txtBody.Lines.length);       	
	tempArray = txtBody.Lines;        
	int Prevsel = txtBody.SelectionStart;       
	string Op = "";      
	int maxLength = cINI.dbUtils.Pref.DefaultEditorWidth;       	
	bool change= false;       
	for(int cou = 0; cou < tempArray.Length ; cou++)
        {        
	if (tempArray[cou].length > maxLength)         	
	{           
		string words = tempArray[cou].split(' ');
	        int currentLine Length = 0;           
		string currentLine = "";            
		foreach(string currentWords 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;
   }
 }
}


The above code is for text_change event of RichText Box in C# vs.net 2003.

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 
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 

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.