Click here to Skip to main content
15,921,959 members
Home / Discussions / C#
   

C#

 
QuestionCrystal Reports: Bad performance on some Win2000 systems? Pin
Pain_Elemental18-Jul-04 18:05
Pain_Elemental18-Jul-04 18:05 
AnswerRe: Crystal Reports: Bad performance on some Win2000 systems? Pin
Daniel Turini19-Jul-04 6:09
Daniel Turini19-Jul-04 6:09 
GeneralRe: Crystal Reports: Bad performance on some Win2000 systems? Pin
Pain_Elemental19-Jul-04 20:57
Pain_Elemental19-Jul-04 20:57 
GeneralProblem with Stored Procedure's Return value Pin
ronin177018-Jul-04 15:23
ronin177018-Jul-04 15:23 
GeneralRe: Problem with Stored Procedure's Return value Pin
woudwijk18-Jul-04 21:19
woudwijk18-Jul-04 21:19 
GeneralRe: Problem with Stored Procedure's Return value Pin
dishanf19-Jul-04 1:19
dishanf19-Jul-04 1:19 
GeneralCalling richTextBox from other namespaces many times Pin
evdoxos18-Jul-04 13:53
evdoxos18-Jul-04 13:53 
GeneralRe: Calling richTextBox from other namespaces many times Pin
Judah Gabriel Himango18-Jul-04 14:48
sponsorJudah Gabriel Himango18-Jul-04 14:48 
Your 'static' change is happening because the Windows Forms designer requires the controls on the form you're designing to be instance variables.

If you want, yes you can pass the rich text box into the functions you want to use it in. No, this is not slow, you're not copying the rich text box, just a small pointer to the rich text box.

A better solution is NOT to use static, and instead pass the rich text box once to the other class, then store that variable in the other class. For instance

class Form1
{
   ...
   // make an instance of the other class
   MyOtherClass theOtherOne = new MyOtherClass(this.richTextBox1);
}

class MyOtherClass
{
   private RichTextBox theRichTextBox = null;
   public MyOtherClass(RichTextBox rtb)
   {
      theRichTextBox = rtb;
   }

   void DoSomething()
   {
      theRichTextBox.Text = "hey I've modified it from another class";
   }
}


#include "witty_sig.h"
GeneralRe: Calling richTextBox from other namespaces many times Pin
evdoxos18-Jul-04 23:00
evdoxos18-Jul-04 23:00 
GeneralMenu like Windows Start menu Pin
webhay18-Jul-04 10:03
webhay18-Jul-04 10:03 
GeneralRe: Menu like Windows Start menu Pin
Heath Stewart19-Jul-04 3:07
protectorHeath Stewart19-Jul-04 3:07 
GeneralRe: Menu like Windows Start menu Pin
webhay19-Jul-04 7:37
webhay19-Jul-04 7:37 
GeneralRe: Menu like Windows Start menu Pin
Heath Stewart19-Jul-04 8:34
protectorHeath Stewart19-Jul-04 8:34 
GeneralRe: Menu like Windows Start menu Pin
Anonymous19-Jul-04 13:07
Anonymous19-Jul-04 13:07 
GeneralDirect X Picturebox Pin
Wjousts18-Jul-04 9:11
Wjousts18-Jul-04 9:11 
QuestionHow we can dealing with TAPI in C# ? Pin
Wail A.Salem18-Jul-04 7:53
Wail A.Salem18-Jul-04 7:53 
AnswerRe: How we can dealing with TAPI in C# ? Pin
Nick Parker18-Jul-04 10:55
protectorNick Parker18-Jul-04 10:55 
QuestionSubscript button for richtextbox? Pin
BrownJacket18-Jul-04 3:28
BrownJacket18-Jul-04 3:28 
AnswerRe: Subscript button for richtextbox? Pin
mav.northwind18-Jul-04 21:57
mav.northwind18-Jul-04 21:57 
GeneralRe: Subscript button for richtextbox? Pin
BrownJacket19-Jul-04 10:39
BrownJacket19-Jul-04 10:39 
GeneralCreating object using ActiveX Component Pin
Member 32469018-Jul-04 3:10
Member 32469018-Jul-04 3:10 
Generalabout dictionary Pin
ala'a ali18-Jul-04 1:29
sussala'a ali18-Jul-04 1:29 
GeneralRe: about dictionary Pin
Colin Angus Mackay18-Jul-04 10:40
Colin Angus Mackay18-Jul-04 10:40 
Generalwho can tell me what's wrong with this function Pin
noosword17-Jul-04 22:13
noosword17-Jul-04 22:13 
Questionhow to get the system shell imagelist Pin
noosword17-Jul-04 17:37
noosword17-Jul-04 17: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.