Click here to Skip to main content
15,905,316 members
Home / Discussions / C#
   

C#

 
AnswerRe: Copy the text of any windows anywhere Pin
OriginalGriff8-Oct-16 0:56
mveOriginalGriff8-Oct-16 0:56 
GeneralRe: Copy the text of any windows anywhere Pin
Daniyaltjm9-Oct-16 5:24
Daniyaltjm9-Oct-16 5:24 
GeneralRe: Copy the text of any windows anywhere Pin
OriginalGriff9-Oct-16 5:50
mveOriginalGriff9-Oct-16 5:50 
GeneralRe: Copy the text of any windows anywhere Pin
Daniyaltjm9-Oct-16 6:12
Daniyaltjm9-Oct-16 6:12 
GeneralRe: Copy the text of any windows anywhere Pin
OriginalGriff9-Oct-16 6:23
mveOriginalGriff9-Oct-16 6:23 
GeneralRe: Copy the text of any windows anywhere Pin
Daniyaltjm9-Oct-16 6:59
Daniyaltjm9-Oct-16 6:59 
GeneralRe: Copy the text of any windows anywhere Pin
NotPolitcallyCorrect9-Oct-16 5:50
NotPolitcallyCorrect9-Oct-16 5:50 
QuestionLine Control in C# 2005 ? Pin
Member 24584677-Oct-16 18:01
Member 24584677-Oct-16 18:01 
AnswerRe: Line Control in C# 2005 ? Pin
OriginalGriff7-Oct-16 19:39
mveOriginalGriff7-Oct-16 19:39 
AnswerRe: Line Control in C# 2005 ? Pin
Garth J Lancaster8-Oct-16 23:48
professionalGarth J Lancaster8-Oct-16 23:48 
QuestionStore persistent data Pin
sunsher6-Oct-16 15:25
sunsher6-Oct-16 15:25 
AnswerRe: Store persistent data Pin
Mycroft Holmes6-Oct-16 20:09
professionalMycroft Holmes6-Oct-16 20:09 
GeneralRe: Store persistent data Pin
OriginalGriff6-Oct-16 22:30
mveOriginalGriff6-Oct-16 22:30 
AnswerRe: Store persistent data Pin
NotPolitcallyCorrect6-Oct-16 23:45
NotPolitcallyCorrect6-Oct-16 23:45 
AnswerRe: Store persistent data Pin
ZurdoDev7-Oct-16 5:12
professionalZurdoDev7-Oct-16 5:12 
PraiseRe: Store persistent data Pin
Eddy Vluggen7-Oct-16 11:47
professionalEddy Vluggen7-Oct-16 11:47 
AnswerRe: Store persistent data Pin
Abhinav S7-Oct-16 20:23
Abhinav S7-Oct-16 20:23 
GeneralRe: Store persistent data Pin
sunsher9-Oct-16 16:26
sunsher9-Oct-16 16:26 
GeneralRe: Store persistent data Pin
Mycroft Holmes9-Oct-16 17:24
professionalMycroft Holmes9-Oct-16 17:24 
GeneralRe: Store persistent data Pin
sunsher10-Oct-16 0:16
sunsher10-Oct-16 0:16 
GeneralRe: Store persistent data Pin
Mycroft Holmes10-Oct-16 12:37
professionalMycroft Holmes10-Oct-16 12:37 
QuestionExecuting PS1 file to perform a task in Exchange Pin
choppol6-Oct-16 12:29
choppol6-Oct-16 12:29 
AnswerRe: Executing PS1 file to perform a task in Exchange Pin
Eddy Vluggen7-Oct-16 11:51
professionalEddy Vluggen7-Oct-16 11:51 
QuestionCan someone explain this WPF oddity? Pin
Foothill6-Oct-16 9:47
professionalFoothill6-Oct-16 9:47 
To set things up, what I was trying to do was make a TextBox flash when a user misses a required input. I got it to work but I don't understand the error I was getting at first.

Code that had an exception:
C#
private void FlashRequiredTextBox(TextBox target)
{
 ColorAnimation flash = new ColorAnimation(Colors.White, Colors.Red, new Duration(TimeSpan.FromMilliseconds(75D))) { AutoReverse = true, RepeatBehavior = new RepeatBehavior(5D) };
 target.Background.BeginAnimation(SolidColorBrush.ColorProperty, flash);
}

The exception that was thrown:
Cannot animate the 'Color' property on 'System.Windows.Media.SolidColorBrush' because the object is sealed or frozen.

I understand why the exception is thrown but what I don't get is why this code fixes it.
C#
private void FlashRequiredTextBox(TextBox target)
{
 ColorAnimation flash = new ColorAnimation(Colors.White, Colors.Red, new Duration(TimeSpan.FromMilliseconds(75D))) { AutoReverse = true, RepeatBehavior = new RepeatBehavior(5D) };
 target.Background = new SolidColorBrush(Colors.White); // set the backbround and voila, no error???
 target.Background.BeginAnimation(SolidColorBrush.ColorProperty, flash);
}

Can somebody with a better understanding of WPF control rendering explain this?
if (Object.DividedByZero == true) { Universe.Implode(); }
Meus ratio ex fortis machina. Simplicitatis de formae ac munus. -Foothill, 2016

AnswerRe: Can someone explain this WPF oddity? PinPopular
Richard Deeming6-Oct-16 11:44
mveRichard Deeming6-Oct-16 11:44 

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.