Click here to Skip to main content
16,004,833 members
Home / Discussions / C#
   

C#

 
GeneralRe: Multithreaded splash form causing weird problems. Need help, code inlcuded. Pin
LongRange.Shooter13-May-06 5:13
LongRange.Shooter13-May-06 5:13 
GeneralRe: Multithreaded splash form causing weird problems. Need help, code inlcuded. Pin
Office Lineman12-May-06 23:03
Office Lineman12-May-06 23:03 
GeneralRe: Multithreaded splash form causing weird problems. Need help, code inlcuded. Pin
LongRange.Shooter13-May-06 5:14
LongRange.Shooter13-May-06 5:14 
QuestionDynamically load DLL class to the project Pin
Virtek11-May-06 6:37
Virtek11-May-06 6:37 
AnswerRe: Dynamically load DLL class to the project Pin
LongRange.Shooter11-May-06 6:49
LongRange.Shooter11-May-06 6:49 
GeneralRe: Dynamically load DLL class to the project Pin
Virtek11-May-06 8:00
Virtek11-May-06 8:00 
QuestionBinding a checkbox to a bool? Pin
iswoolley11-May-06 5:53
iswoolley11-May-06 5:53 
AnswerRe: Binding a checkbox to a bool? Pin
J4amieC11-May-06 6:03
J4amieC11-May-06 6:03 
you're gonna love this one.

What you have setup so far is 1-way binding. That is to say that by binding your object's Value property to the checkbox's Checked property checking or unchecking the checkbox would affect your object. You should try this to confirm the behaviour.

In order to setup 2-way binding, which will update the checkbox when the underlying Value property chenges, you need a way to notify the UI that the data source's value has changed.

You do this by implementing a PropertyNameChanged event. So in your class you would have something like:

class ToggleClass<br />
{<br />
private bool value;<br />
<br />
public event EventHandler ValueChanged<br />
<br />
public bool Value<br />
{<br />
get { return value; }<br />
<br />
}<br />
<br />
public ToggleClass ()<br />
{<br />
value=false;<br />
}<br />
<br />
public void Toggle ()<br />
{<br />
while(true)<br />
{<br />
value=!value;<br />
if(ValueChanged != null)<br />
  ValueChanged(this,EventArgs.Empty)<br />
Thread.Sleep(1000);<br />
}<br />
}<br />
}


Here is some extra reading for you:
http://msdn2.microsoft.com/en-us/library/xz45s2bh.aspx[^]

Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour


-- modified at 12:05 Thursday 11th May, 2006
GeneralRe: Binding a checkbox to a bool? Pin
iswoolley11-May-06 7:16
iswoolley11-May-06 7:16 
QuestionOnly able to print once? Pin
melanieab11-May-06 5:33
melanieab11-May-06 5:33 
AnswerRe: Only able to print once? Pin
LongRange.Shooter11-May-06 6:56
LongRange.Shooter11-May-06 6:56 
GeneralRe: Only able to print once? Pin
melanieab11-May-06 9:15
melanieab11-May-06 9:15 
GeneralRe: Only able to print once? Pin
melanieab12-May-06 6:05
melanieab12-May-06 6:05 
GeneralRe: Only able to print once? Pin
Martin#16-Nov-06 22:57
Martin#16-Nov-06 22:57 
Questionoverrride onpaint Pin
Sasuko11-May-06 4:27
Sasuko11-May-06 4:27 
AnswerRe: overrride onpaint Pin
Ravi Bhavnani11-May-06 4:55
professionalRavi Bhavnani11-May-06 4:55 
AnswerRe: overrride onpaint Pin
leppie11-May-06 7:52
leppie11-May-06 7:52 
QuestionWhy doesn't my code crash? Passing Int64 to Int32 Pin
nicknotyet11-May-06 4:07
nicknotyet11-May-06 4:07 
AnswerRe: Why doesn't my code crash? Passing Int64 to Int32 Pin
Judah Gabriel Himango11-May-06 5:22
sponsorJudah Gabriel Himango11-May-06 5:22 
GeneralRe: Why doesn't my code crash? Passing Int64 to Int32 Pin
nicknotyet11-May-06 5:54
nicknotyet11-May-06 5:54 
GeneralRe: Why doesn't my code crash? Passing Int64 to Int32 Pin
Judah Gabriel Himango11-May-06 5:59
sponsorJudah Gabriel Himango11-May-06 5:59 
GeneralRe: Why doesn't my code crash? Passing Int64 to Int32 Pin
led mike11-May-06 6:21
led mike11-May-06 6:21 
GeneralRe: Why doesn't my code crash? Passing Int64 to Int32 Pin
nicknotyet11-May-06 11:44
nicknotyet11-May-06 11:44 
GeneralRe: Why doesn't my code crash? Passing Int64 to Int32 Pin
Matt Newman11-May-06 19:26
Matt Newman11-May-06 19:26 
GeneralRe: Why doesn't my code crash? Passing Int64 to Int32 Pin
nicknotyet12-May-06 3:37
nicknotyet12-May-06 3: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.