Click here to Skip to main content
15,851,711 members
Home / Discussions / C#
   

C#

 
GeneralRe: SQL with C# Pin
EliottA25-Sep-09 5:43
EliottA25-Sep-09 5:43 
QuestionHow to automatically scroll text up in a richtext box. Pin
Sophronis Mantoles25-Sep-09 4:02
Sophronis Mantoles25-Sep-09 4:02 
AnswerRe: How to automatically scroll text up in a richtext box. Pin
Calla25-Sep-09 4:22
Calla25-Sep-09 4:22 
GeneralRe: How to automatically scroll text up in a richtext box. [modified] Pin
Sophronis Mantoles25-Sep-09 5:51
Sophronis Mantoles25-Sep-09 5:51 
AnswerRe: How to automatically scroll text up in a richtext box. Pin
Alan N25-Sep-09 4:24
Alan N25-Sep-09 4:24 
AnswerRe: How to automatically scroll text up in a richtext box. Pin
Henry Minute25-Sep-09 4:27
Henry Minute25-Sep-09 4: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 4:01
Anıl Yıldız25-Sep-09 4:01 
AnswerRe: Which one is better, forcing an enabled=true at each call or check it with an if statement? Pin
freakyit25-Sep-09 5:07
freakyit25-Sep-09 5: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 5:18
Anıl Yıldız25-Sep-09 5:18 
GeneralRe: Which one is better, forcing an enabled=true at each call or check it with an if statement? Pin
PIEBALDconsult25-Sep-09 6:32
mvePIEBALDconsult25-Sep-09 6:32 
GeneralRe: Which one is better, forcing an enabled=true at each call or check it with an if statement? Pin
freakyit25-Sep-09 8:00
freakyit25-Sep-09 8:00 
GeneralRe: Which one is better, forcing an enabled=true at each call or check it with an if statement? Pin
PIEBALDconsult25-Sep-09 8:10
mvePIEBALDconsult25-Sep-09 8:10 
AnswerRe: Which one is better, forcing an enabled=true at each call or check it with an if statement? Pin
PIEBALDconsult25-Sep-09 6:06
mvePIEBALDconsult25-Sep-09 6:06 
AnswerRe: Which one is better, forcing an enabled=true at each call or check it with an if statement? Pin
PIEBALDconsult25-Sep-09 7:51
mvePIEBALDconsult25-Sep-09 7: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 8:02
Anıl Yıldız25-Sep-09 8:02 
GeneralRe: Which one is better, forcing an enabled=true at each call or check it with an if statement? Pin
freakyit25-Sep-09 8:07
freakyit25-Sep-09 8:07 
GeneralRe: Which one is better, forcing an enabled=true at each call or check it with an if statement? Pin
freakyit25-Sep-09 8:05
freakyit25-Sep-09 8:05 
GeneralRe: Which one is better, forcing an enabled=true at each call or check it with an if statement? Pin
PIEBALDconsult25-Sep-09 8:20
mvePIEBALDconsult25-Sep-09 8:20 
QuestionProblems with ID Automation Pin
Qendro25-Sep-09 3:40
Qendro25-Sep-09 3:40 
GeneralRe: Problems with ID Automation Pin
musefan25-Sep-09 3:56
musefan25-Sep-09 3:56 
GeneralRe: Problems with ID Automation Pin
Qendro25-Sep-09 4:04
Qendro25-Sep-09 4:04 
QuestionPrinting multiple font sizes on the same page... Pin
jameschristianii25-Sep-09 3:37
jameschristianii25-Sep-09 3:37 
AnswerRe: Printing multiple font sizes on the same page... Pin
musefan25-Sep-09 3:54
musefan25-Sep-09 3:54 
GeneralRe: Printing multiple font sizes on the same page... Pin
jameschristianii25-Sep-09 4:07
jameschristianii25-Sep-09 4:07 
GeneralRe: Printing multiple font sizes on the same page... Pin
musefan25-Sep-09 5:24
musefan25-Sep-09 5: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.