Click here to Skip to main content
15,913,685 members
Home / Discussions / C#
   

C#

 
GeneralRe: Identifying the type of file Pin
Thomas Krojer23-Aug-07 0:53
Thomas Krojer23-Aug-07 0:53 
AnswerRe: Identifying the type of file Pin
Giorgi Dalakishvili21-Aug-07 22:07
mentorGiorgi Dalakishvili21-Aug-07 22:07 
QuestionHelp me in Invoking Dll's Pin
kandy_soliton21-Aug-07 19:38
kandy_soliton21-Aug-07 19:38 
AnswerRe: Help me in Invoking Dll's Pin
Christian Graus21-Aug-07 20:00
protectorChristian Graus21-Aug-07 20:00 
GeneralRe: Help me in Invoking Dll's Pin
Giorgi Dalakishvili21-Aug-07 22:09
mentorGiorgi Dalakishvili21-Aug-07 22:09 
QuestionQuickFix protocol Pin
sujithkumarsl21-Aug-07 19:07
sujithkumarsl21-Aug-07 19:07 
AnswerRe: QuickFix protocol Pin
Ankit Aneja21-Aug-07 21:30
Ankit Aneja21-Aug-07 21:30 
QuestionWhat is Reason? (plz reply) [modified] Pin
Hum Dum21-Aug-07 19:00
Hum Dum21-Aug-07 19:00 
I had write code on text_change event of richText box in C#.net for wordwrap.

When i created the project and tested it its working fine, so i copy it make exe. Now problem is its showing some problem. so i check this code with oroginal code. In original code its working fine, but in copied code it showing problem.

The problem is like, after 3-4 line, at end of line its giving space in 2 letter like "Him" as "H i m", and adding "/n"at end of text.

Here maxLength is variable for no. of chracter like 65,66 etc per line, And if there is somthing wrong with code then plz help me.(not mismatch of { })


I want to know:

1. Code is for text_changed event & exact same in both, So why it like this?

2. Its only for text_change event and I dont think it has any relation with any other project part, i m using the text but after it has been put by the user.

The code for event is:
<br />
private void txtBody_TextChanged(object sender, eventArgs e)<br />
{<br />
    <pre>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; 
   }
 }
}</pre><br />
<br />
<br />
 -- modified at 1:11 Wednesday 22nd August, 2007

AnswerRe: What is Reason? (plz reply) Pin
Christian Graus21-Aug-07 19:59
protectorChristian Graus21-Aug-07 19:59 
QuestionHow to print datagidview with form control Pin
tech-progg21-Aug-07 17:14
tech-progg21-Aug-07 17:14 
AnswerRe: How to print datagidview with form control Pin
Syed Mujtaba Hassan21-Aug-07 18:55
Syed Mujtaba Hassan21-Aug-07 18:55 
QuestionsQL with C# update question Pin
falles0121-Aug-07 13:39
falles0121-Aug-07 13:39 
AnswerRe: sQL with C# update question Pin
Christian Graus21-Aug-07 13:41
protectorChristian Graus21-Aug-07 13:41 
GeneralRe: sQL with C# update question Pin
falles0121-Aug-07 13:47
falles0121-Aug-07 13:47 
GeneralRe: sQL with C# update question Pin
Christian Graus21-Aug-07 17:00
protectorChristian Graus21-Aug-07 17:00 
GeneralRe: sQL with C# update question Pin
Christian Graus21-Aug-07 17:19
protectorChristian Graus21-Aug-07 17:19 
GeneralRe: sQL with C# update question Pin
falles0122-Aug-07 13:16
falles0122-Aug-07 13:16 
GeneralRe: sQL with C# update question Pin
Christian Graus23-Aug-07 13:44
protectorChristian Graus23-Aug-07 13:44 
GeneralRe: sQL with C# update question Pin
falles0123-Aug-07 14:03
falles0123-Aug-07 14:03 
GeneralRe: sQL with C# update question Pin
Christian Graus23-Aug-07 16:55
protectorChristian Graus23-Aug-07 16:55 
GeneralRe: sQL with C# update question Pin
falles0122-Aug-07 13:18
falles0122-Aug-07 13:18 
GeneralRe: sQL with C# update question Pin
falles0121-Aug-07 13:58
falles0121-Aug-07 13:58 
GeneralRe: sQL with C# update question Pin
Christian Graus21-Aug-07 16:58
protectorChristian Graus21-Aug-07 16:58 
AnswerRe: sQL with C# update question Pin
Nouman Bhatti21-Aug-07 21:05
Nouman Bhatti21-Aug-07 21:05 
GeneralRe: sQL with C# update question Pin
Christian Graus21-Aug-07 21:51
protectorChristian Graus21-Aug-07 21:51 

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.