Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
GeneralRe: SQL with C# Pin
EliottA25-Sep-09 4:43
EliottA25-Sep-09 4:43 
QuestionHow to automatically scroll text up in a richtext box. Pin
Sophronis Mantoles25-Sep-09 3:02
Sophronis Mantoles25-Sep-09 3:02 
AnswerRe: How to automatically scroll text up in a richtext box. Pin
Calla25-Sep-09 3:22
Calla25-Sep-09 3:22 
GeneralRe: How to automatically scroll text up in a richtext box. [modified] Pin
Sophronis Mantoles25-Sep-09 4:51
Sophronis Mantoles25-Sep-09 4:51 
AnswerRe: How to automatically scroll text up in a richtext box. Pin
Alan N25-Sep-09 3:24
Alan N25-Sep-09 3:24 
AnswerRe: How to automatically scroll text up in a richtext box. Pin
Henry Minute25-Sep-09 3:27
Henry Minute25-Sep-09 3:27 
QuestionWhich one is better, forcing an enabled=true at each call or check it with an if statement? Pin
Anıl Yıldız25-Sep-09 3:01
Anıl Yıldız25-Sep-09 3:01 
AnswerRe: Which one is better, forcing an enabled=true at each call or check it with an if statement? Pin
freakyit25-Sep-09 4:07
freakyit25-Sep-09 4:07 
hi,

the second one is better coding i would say.
but first you have to clarify whether the property does set the new value if the value changed or not.

the code below demonstrates working with no if-clause because it will be checked before setting the new value..

private bool _enabled = false;
public new bool Enabled {
    get { return __enabled; }
    set { 
          if(enabled != value)
          {
              enabled = value; 
	      this.Invalidate(); // this would be the way i would draw the button disabled in the OnPaint() Method
	  }
    }
}	

in this case the code below shows a check if button is enabled would be a right way, because every time the value will be set the button would redraw although nothing changed.

private bool _enabled = false;
public new bool Enabled {
    get { return __enabled; }
    set { 
         enabled = value; 
	 this.Invalidate(); 
    }
}	


hope i could help you..

bless
GeneralRe: Which one is better, forcing an enabled=true at each call or check it with an if statement? Pin
Anıl Yıldız25-Sep-09 4:18
Anıl Yıldız25-Sep-09 4:18 
GeneralRe: Which one is better, forcing an enabled=true at each call or check it with an if statement? Pin
PIEBALDconsult25-Sep-09 5:32
mvePIEBALDconsult25-Sep-09 5:32 
GeneralRe: Which one is better, forcing an enabled=true at each call or check it with an if statement? Pin
freakyit25-Sep-09 7:00
freakyit25-Sep-09 7:00 
GeneralRe: Which one is better, forcing an enabled=true at each call or check it with an if statement? Pin
PIEBALDconsult25-Sep-09 7:10
mvePIEBALDconsult25-Sep-09 7:10 
AnswerRe: Which one is better, forcing an enabled=true at each call or check it with an if statement? Pin
PIEBALDconsult25-Sep-09 5:06
mvePIEBALDconsult25-Sep-09 5:06 
AnswerRe: Which one is better, forcing an enabled=true at each call or check it with an if statement? Pin
PIEBALDconsult25-Sep-09 6:51
mvePIEBALDconsult25-Sep-09 6:51 
GeneralRe: Which one is better, forcing an enabled=true at each call or check it with an if statement? Pin
Anıl Yıldız25-Sep-09 7:02
Anıl Yıldız25-Sep-09 7:02 
GeneralRe: Which one is better, forcing an enabled=true at each call or check it with an if statement? Pin
freakyit25-Sep-09 7:07
freakyit25-Sep-09 7:07 
GeneralRe: Which one is better, forcing an enabled=true at each call or check it with an if statement? Pin
freakyit25-Sep-09 7:05
freakyit25-Sep-09 7:05 
GeneralRe: Which one is better, forcing an enabled=true at each call or check it with an if statement? Pin
PIEBALDconsult25-Sep-09 7:20
mvePIEBALDconsult25-Sep-09 7:20 
QuestionProblems with ID Automation Pin
Qendro25-Sep-09 2:40
Qendro25-Sep-09 2:40 
GeneralRe: Problems with ID Automation Pin
musefan25-Sep-09 2:56
musefan25-Sep-09 2:56 
GeneralRe: Problems with ID Automation Pin
Qendro25-Sep-09 3:04
Qendro25-Sep-09 3:04 
QuestionPrinting multiple font sizes on the same page... Pin
jameschristianii25-Sep-09 2:37
jameschristianii25-Sep-09 2:37 
AnswerRe: Printing multiple font sizes on the same page... Pin
musefan25-Sep-09 2:54
musefan25-Sep-09 2:54 
GeneralRe: Printing multiple font sizes on the same page... Pin
jameschristianii25-Sep-09 3:07
jameschristianii25-Sep-09 3:07 
GeneralRe: Printing multiple font sizes on the same page... Pin
musefan25-Sep-09 4:24
musefan25-Sep-09 4:24 

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.