Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
GeneralRe: 'using' vs fully qualified types Pin
Luc Pattyn18-Aug-07 12:53
sitebuilderLuc Pattyn18-Aug-07 12:53 
GeneralRe: 'using' vs fully qualified types Pin
PIEBALDconsult18-Aug-07 18:49
mvePIEBALDconsult18-Aug-07 18:49 
AnswerRe: 'using' vs fully qualified types Pin
PIEBALDconsult18-Aug-07 9:52
mvePIEBALDconsult18-Aug-07 9:52 
GeneralRe: 'using' vs fully qualified types Pin
Colin Angus Mackay18-Aug-07 13:32
Colin Angus Mackay18-Aug-07 13:32 
GeneralRe: 'using' vs fully qualified types Pin
Mark Churchill18-Aug-07 16:10
Mark Churchill18-Aug-07 16:10 
GeneralRe: 'using' vs fully qualified types Pin
PIEBALDconsult18-Aug-07 18:37
mvePIEBALDconsult18-Aug-07 18:37 
AnswerRe: 'using' vs fully qualified types Pin
PIEBALDconsult18-Aug-07 18:53
mvePIEBALDconsult18-Aug-07 18:53 
QuestionProblem with text editor - Plz Help( need badly) Pin
Hum Dum17-Aug-07 22:07
Hum Dum17-Aug-07 22:07 
private void txtBody_TextChanged(object sender, eventArgs e)<br />
{<br />
    if(tbWordwrap.Pushed)<br />
    {<br />
       string[] tempArray = new string(txtBody.Lines.length);<br />
       tempArray = txtBody.Lines;<br />
 <br />
       int Prevsel = txtBody.SelectionStart;<br />
       string Op = "";<br />
       int maxLength = cINI.dbUtils.Pref.DefaultEditorWidth;<br />
      bool change= false;<br />
 <br />
      for(int cou = 0; cou < tempArray.Length; cou++)<br />
      {<br />
        if (tempArray[cou].length > maxLength)<br />
         {<br />
           string words = tempArray[cou].split(' ');<br />
           int currentLine Length = 0;<br />
           string currentLine = "";<br />
           foreach(string currentWords in words)<br />
           {<br />
            if(currentWord.Length > 0)<br />
            { <br />
              if(currentword.Length >= maxLength)<br />
               {<br />
                Op +=currentword.Insert(maxLength, "\r\n");<br />
                break;<br />
               }<br />
             if(currentLineLength + currentword.Length + 1 < maxLength)<br />
             {<br />
                currentLine += currentword + " ";<br />
                currentLineLength += currentword.Length +1;<br />
             }<br />
             else<br />
             {<br />
               Op +=currentLine.Insert(currentLineLength, "\r\n");<br />
               currentLine = currentWord;<br />
               currentLineLength = currentWord.Length;<br />
             }<br />
           }<br />
         }<br />
         if(currentLine !="")<br />
          Op += currentLine;<br />
          <br />
          <br />
          PrevSel++;<br />
          change = true;<br />
      }<br />
      else<br />
      {<br />
        Op += tempArray[cou] + "\r\n";<br />
      }<br />
   if(change)<br />
   {<br />
     txtBody.Text = Op;<br />
     txtBody.SelectionStart = prevSel;<br />
   }<br />
}<br />
<br />
           Op += tempArray[cou].Insert(maxLength, "\r\n" );<br />
           Prevsel++;<br />
           change= true;<br />
         }<br />
         else<br />
        {<br />
          Op += tempArray(cou) + "\r\n";<br />
         }<br />
      }<br />
 <br />
      if(change)<br />
      {<br />
        txtBody.Text = Op;<br />
        txtbody.SelectionStart = Prevsel;<br />
      }<br />
}<br />
}<br />
<br />
<br />



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

Its working fine, But there are some problem which i am i m unable to understand why r coming,

1. In rare cases there occurs a problem like it automatically gives spaces between two letters, like "Him". It gives "H i m",

2. Also dont know why its cuts the word at end of line, like Accept is word,
then Acc to upper line ept to next line, This also comes rarely.

I m unableto short out the problem plz, help.
Here maxLength is variable where user can put no. of chracters he wants in a line, like 65, 68, etc.
AnswerRe: Problem with text editor - Plz Help( need badly) Pin
Christian Graus17-Aug-07 22:42
protectorChristian Graus17-Aug-07 22:42 
AnswerRe: Problem with text editor - Plz Help( need badly) Pin
Luc Pattyn18-Aug-07 0:22
sitebuilderLuc Pattyn18-Aug-07 0:22 
QuestionHow to Access Main Class in Inner Class ... Pin
Doug.Chen17-Aug-07 21:43
Doug.Chen17-Aug-07 21:43 
AnswerRe: How to Access Main Class in Inner Class ... Pin
Hessam Jalali17-Aug-07 22:00
Hessam Jalali17-Aug-07 22:00 
AnswerRe: How to Access Main Class in Inner Class ... Pin
Christian Graus17-Aug-07 22:44
protectorChristian Graus17-Aug-07 22:44 
AnswerRe: How to Access Main Class in Inner Class ... Pin
Luc Pattyn18-Aug-07 0:26
sitebuilderLuc Pattyn18-Aug-07 0:26 
Questiontool tip in Close box Pin
topksharma198217-Aug-07 21:16
topksharma198217-Aug-07 21:16 
QuestionNo overload for method 'Open' takes '13' arguments.... Pin
shafikshafik17-Aug-07 20:49
shafikshafik17-Aug-07 20:49 
AnswerRe: No overload for method 'Open' takes '13' arguments.... Pin
Christian Graus17-Aug-07 20:57
protectorChristian Graus17-Aug-07 20:57 
AnswerRe: No overload for method 'Open' takes '13' arguments.... Pin
Luc Pattyn18-Aug-07 0:26
sitebuilderLuc Pattyn18-Aug-07 0:26 
QuestionImporting xsd Pin
dnlstffrd17-Aug-07 19:57
dnlstffrd17-Aug-07 19:57 
QuestionRe:Displaying child windows Pin
RameshwerE17-Aug-07 19:34
RameshwerE17-Aug-07 19:34 
AnswerRe:Displaying child windows Pin
Rocky#17-Aug-07 19:50
Rocky#17-Aug-07 19:50 
AnswerRe:Displaying child windows Pin
Christian Graus17-Aug-07 20:14
protectorChristian Graus17-Aug-07 20:14 
AnswerRe:Displaying child windows Pin
Doug.Chen17-Aug-07 21:54
Doug.Chen17-Aug-07 21:54 
QuestionRe:Displaying child windows Pin
Doug.Chen17-Aug-07 21:59
Doug.Chen17-Aug-07 21:59 
AnswerRe:Displaying child windows Pin
Hessam Jalali17-Aug-07 22:10
Hessam Jalali17-Aug-07 22:10 

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.