Click here to Skip to main content
15,899,679 members
Home / Discussions / C#
   

C#

 
GeneralRe: How can i detect if a path is valid. Pin
Saksida Bojan14-Aug-09 5:05
Saksida Bojan14-Aug-09 5:05 
QuestionC# and JavaScript. [modified] Pin
Evgeni5714-Aug-09 3:34
Evgeni5714-Aug-09 3:34 
AnswerRe: C# and JavaScript. Pin
Evgeni5717-Aug-09 1:41
Evgeni5717-Aug-09 1:41 
QuestionLogging Pin
Saksida Bojan14-Aug-09 3:02
Saksida Bojan14-Aug-09 3:02 
AnswerRe: Logging Pin
0x3c014-Aug-09 3:20
0x3c014-Aug-09 3:20 
QuestionAccess OleDb on x64 Pin
V.14-Aug-09 2:43
professionalV.14-Aug-09 2:43 
AnswerRe: Access OleDb on x64 Pin
Hristo-Bojilov14-Aug-09 22:20
Hristo-Bojilov14-Aug-09 22:20 
GeneralRe: Access OleDb on x64 Pin
V.17-Aug-09 23:43
professionalV.17-Aug-09 23:43 
Questionlog4net doesn't log in myProcess.OutputDataReceived Pin
buchstaben14-Aug-09 1:53
buchstaben14-Aug-09 1:53 
QuestionSqlDataReader-Ouput Parameter And SqlConnection Pin
Nagaraj Muthuchamy14-Aug-09 1:12
professionalNagaraj Muthuchamy14-Aug-09 1:12 
AnswerRe: SqlDataReader-Ouput Parameter And SqlConnection Pin
Ashfield14-Aug-09 1:17
Ashfield14-Aug-09 1:17 
GeneralRe: SqlDataReader-Ouput Parameter And SqlConnection Pin
Nagaraj Muthuchamy14-Aug-09 1:25
professionalNagaraj Muthuchamy14-Aug-09 1:25 
GeneralRe: SqlDataReader-Ouput Parameter And SqlConnection Pin
Coding C#14-Aug-09 1:29
Coding C#14-Aug-09 1:29 
GeneralRe: SqlDataReader-Ouput Parameter And SqlConnection Pin
Ashfield14-Aug-09 2:57
Ashfield14-Aug-09 2:57 
GeneralRe: SqlDataReader-Ouput Parameter And SqlConnection Pin
Pete O'Hanlon14-Aug-09 3:01
mvePete O'Hanlon14-Aug-09 3:01 
GeneralRe: SqlDataReader-Ouput Parameter And SqlConnection Pin
Ashfield14-Aug-09 5:05
Ashfield14-Aug-09 5:05 
QuestionDisabling a button on one form from another. Pin
False Chicken14-Aug-09 0:28
False Chicken14-Aug-09 0:28 
AnswerRe: Disabling a button on one form from another. Pin
DaveyM6914-Aug-09 0:53
professionalDaveyM6914-Aug-09 0:53 
AnswerRe: Disabling a button on one form from another. Pin
DaveyM6914-Aug-09 1:00
professionalDaveyM6914-Aug-09 1:00 
GeneralRe: Disabling a button on one form from another. Pin
False Chicken14-Aug-09 1:06
False Chicken14-Aug-09 1:06 
AnswerRe: Disabling a button on one form from another. Pin
Hristo-Bojilov14-Aug-09 1:08
Hristo-Bojilov14-Aug-09 1:08 
GeneralRe: Disabling a button on one form from another. Pin
False Chicken14-Aug-09 1:15
False Chicken14-Aug-09 1:15 
GeneralRe: Disabling a button on one form from another. Pin
DaveyM6914-Aug-09 1:39
professionalDaveyM6914-Aug-09 1:39 
Working Example:
// FormButton.cs
using System;
using System.Windows.Forms;

public partial class FormButton : Form
{
    public FormButton()
    {
        InitializeComponent();
    }

    private void FormButton_Load(object sender, EventArgs e)
    {
        FormCheckBox formCheckBox = new FormCheckBox();
        formCheckBox.CheckStateChanged += formCheckBox_CheckStateChanged;
        formCheckBox.Show();
    }

    void formCheckBox_CheckStateChanged(object sender, CheckStateEventArgs e)
    {
        button1.Enabled = e.IsChecked;
    }
}
// FormCheckBox.cs
using System;
using System.Windows.Forms;

public partial class FormCheckBox : Form
{
    public event EventHandler<CheckStateEventArgs> CheckStateChanged;
    public FormCheckBox()
    {
        InitializeComponent();
    }

    private void checkBox1_CheckStateChanged(object sender, EventArgs e)
    {
        OnCheckStateChanged(new CheckStateEventArgs(checkBox1.Checked));
    }

    protected virtual void OnCheckStateChanged(CheckStateEventArgs e)
    {
        EventHandler<CheckStateEventArgs> eh = CheckStateChanged;
        if (eh != null)
            eh(this, e);
    }
}
// CheckStateEventArgs.cs
public class CheckStateEventArgs : EventArgs
{
    public CheckStateEventArgs(bool isChecked)
    {
        IsChecked = isChecked;
    }
    public bool IsChecked
    {
        get;
        private set;
    }
}


Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
Why are you using VB6? Do you hate yourself? (Christian Graus)

GeneralRe: Disabling a button on one form from another. Pin
Hristo-Bojilov14-Aug-09 2:01
Hristo-Bojilov14-Aug-09 2:01 
QuestionDelegateSerializationHolder is not permitted to be deserialized at this security level Pin
Nigel Mackay14-Aug-09 0:08
Nigel Mackay14-Aug-09 0:08 

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.