Click here to Skip to main content
15,903,012 members
Home / Discussions / C#
   

C#

 
GeneralRe: Array of class with implicit conversion Pin
DaveyM6917-Aug-09 11:37
professionalDaveyM6917-Aug-09 11:37 
GeneralRe: Array of class with implicit conversion Pin
Luc Pattyn17-Aug-09 13:08
sitebuilderLuc Pattyn17-Aug-09 13:08 
AnswerRe: Array of class with implicit conversion Pin
PIEBALDconsult17-Aug-09 13:19
mvePIEBALDconsult17-Aug-09 13:19 
Questionaccessing control's value from a seperate class. Pin
JollyMansArt17-Aug-09 11:07
JollyMansArt17-Aug-09 11:07 
AnswerRe: accessing control's value from a seperate class. Pin
Saksida Bojan17-Aug-09 11:15
Saksida Bojan17-Aug-09 11:15 
AnswerRe: accessing control's value from a seperate class. Pin
MarkLTX17-Aug-09 11:29
MarkLTX17-Aug-09 11:29 
AnswerRe: accessing control's value from a seperate class. Pin
DaveyM6917-Aug-09 11:32
professionalDaveyM6917-Aug-09 11:32 
QuestionRe: accessing control's value from a seperate class. [modified] What am I doing wrong? Pin
JollyMansArt17-Aug-09 11:45
JollyMansArt17-Aug-09 11:45 
Here is what I am trying to do...





This is the code I want to call by 1 procedure retruning a bool value

    private void EnableDisableSaveChanges(String txtboxName, String txtValue)
{
    if (ckbxUniqueName.Checked == true)
    {
        if (HastxtAppNameControlValueChanged & HastxtVerNumberControlValueChanged & HastxtServerLocControlValueChanged & HastxtServerFileNameControlValueChanged & HastxtClientLocFileNameControlValueChanged & HastxtClientFileNameControlValueChanged & HasckbxMasterApplicationControlValueChanged & HasckbxCreateShortcutControlValueChanged & HasckbxUniqueNameControlValueChanged & HasrbtnClientMachineControlValueChanged & HasrbtnClientUserControlValueChanged)
        {
            btnSaveChanges.Enabled = true;
        }
        else
        {
            btnSaveChanges.Enabled = false;
        }
    }
    else
    {
        if (HastxtAppNameControlValueChanged & HastxtVerNumberControlValueChanged & HastxtServerLocControlValueChanged & HastxtServerFileNameControlValueChanged & HastxtClientLocFileNameControlValueChanged & HastxtClientFileNameControlValueChanged & HasckbxMasterApplicationControlValueChanged & HasckbxCreateShortcutControlValueChanged & HasckbxUniqueNameControlValueChanged)
        {
            btnSaveChanges.Enabled = true;
        }
        else
        {
            btnSaveChanges.Enabled = false;
        }
    }



This is the code I want in a seperate class with a main procedure I can call to return a bool value which is above...
#region Validate if a change has occured to any of the fields on tab 1.
////////////////////////////////////
private Boolean HastxtAppNameControlValueChanged()
{
    if (txtAppName.Text == UnchangedAppNameField || txtAppName.Text == null || txtAppName.Text == "")
    {
        return false;
    }
    else
    {
        return true;
    }
}
private Boolean HastxtVerNumberControlValueChanged()
{
    if (txtVerNumber.Text == UnchangedAppVersionField || txtVerNumber.Text == null || txtVerNumber.Text == "")
    {
        return false;
    }
    else
    {
        return true;
    }
}
private Boolean HastxtServerLocControlValueChanged()
{
    if (txtServerLoc.Text == UnchangedServerPathLocField || txtServerLoc.Text == null || txtServerLoc.Text == "")
    {
        return false;
    }
    else
    {
        return true;
    }
}
private Boolean HastxtServerFileNameControlValueChanged()
{
    if (txtServerFileName.Text == UnchangedServerFileNameField || txtServerFileName.Text == null || txtServerFileName.Text == "")
    {
        return false;
    }
    else
    {
        return true;
    }
}
private Boolean HastxtClientLocFileNameControlValueChanged()
{
    if (txtClientLoc.Text == UnchangedClientPathLocField || txtClientLoc.Text == null || txtClientLoc.Text == "")
    {
        return false;
    }
    else
    {
        return true;
    }
}
private Boolean HastxtClientFileNameControlValueChanged()
{
    if (txtClientFileName.Text == UnchangedClientFileNameField || txtClientFileName.Text == null || txtClientFileName.Text == "")
    {
        return false;
    }
    else
    {
        return true;
    }
}
private Boolean HasckbxMasterApplicationControlValueChanged()
{
    if (ckbxMasterApplication.Checked == UnchangedMasterAppField)
    {
        return false;
    }
    else
    {
        return true;
    }
}
private Boolean HasckbxCreateShortcutControlValueChanged()
{
    if (ckbxCreateShortcut.Checked == UnchangedCreateShortcut)
    {
        return false;
    }
    else
    {
        return true;
    }
}
private Boolean HasckbxUniqueNameControlValueChanged()
{
    if (ckbxUniqueName.Checked == UnchangedUniqueName)
    {
        return false;
    }
    else
    {
        return true;
    }
}
private Boolean HasrbtnClientMachineControlValueChanged()
{
    if (rbtnClientMachine.Checked == UnchangedClientMachine)
    {
        return false;
    }
    else
    {
        return true;
    }
}
private Boolean HasrbtnClientUserControlValueChanged()
{
    if (rbtnClientUser.Checked == UnchangedClientUser)
    {
        return false;
    }
    else
    {
        return true;
    }
}
////delete/////



#endregion


modified on Monday, August 17, 2009 6:03 PM

QuestionRe: accessing control's value from a seperate class. [modified] What am I doing wrong? Pin
JollyMansArt17-Aug-09 12:07
JollyMansArt17-Aug-09 12:07 
AnswerRe: accessing control's value from a seperate class. [modified] What am I doing wrong? Pin
DaveyM6917-Aug-09 12:20
professionalDaveyM6917-Aug-09 12:20 
QuestionRe: accessing control's value from a seperate class. [modified] What am I doing wrong? (Simplified...) Pin
JollyMansArt17-Aug-09 12:32
JollyMansArt17-Aug-09 12:32 
AnswerRe: accessing control's value from a seperate class. [modified] What am I doing wrong? Pin
Henry Minute17-Aug-09 12:57
Henry Minute17-Aug-09 12:57 
AnswerRe: accessing control's value from a seperate class. Pin
Luc Pattyn17-Aug-09 13:13
sitebuilderLuc Pattyn17-Aug-09 13:13 
QuestionForm reload Pin
neha_rai17-Aug-09 9:27
neha_rai17-Aug-09 9:27 
AnswerRe: Form reload Pin
kevinnicol17-Aug-09 9:33
kevinnicol17-Aug-09 9:33 
AnswerRe: Form reload Pin
Adam R Harris17-Aug-09 10:20
Adam R Harris17-Aug-09 10:20 
AnswerRe: Form reload Pin
Pete O'Hanlon17-Aug-09 10:50
mvePete O'Hanlon17-Aug-09 10:50 
AnswerRe: Form reload Pin
Luc Pattyn17-Aug-09 13:16
sitebuilderLuc Pattyn17-Aug-09 13:16 
Questionconnection to other computer using C#(REPOST) Pin
CoderForEver17-Aug-09 8:43
CoderForEver17-Aug-09 8:43 
QuestionC# Host with IP address detect! Pin
nhqlbaislwfiikqraqnm17-Aug-09 8:41
nhqlbaislwfiikqraqnm17-Aug-09 8:41 
AnswerRe: C# Host with IP address detect! Pin
ricmil4217-Aug-09 9:10
ricmil4217-Aug-09 9:10 
GeneralRe: C# Host with IP address detect! Pin
nhqlbaislwfiikqraqnm17-Aug-09 9:46
nhqlbaislwfiikqraqnm17-Aug-09 9:46 
GeneralRe: C# Host with IP address detect! Pin
ricmil4217-Aug-09 9:52
ricmil4217-Aug-09 9:52 
AnswerRe: C# Host with IP address detect! Pin
nhqlbaislwfiikqraqnm17-Aug-09 10:01
nhqlbaislwfiikqraqnm17-Aug-09 10:01 
GeneralRe: C# Host with IP address detect! Pin
nhqlbaislwfiikqraqnm17-Aug-09 10:02
nhqlbaislwfiikqraqnm17-Aug-09 10:02 

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.