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

C#

 
Questionhangman code in C Pin
Member 1118939529-Oct-14 10:49
Member 1118939529-Oct-14 10:49 
AnswerRe: hangman code in C Pin
Eddy Vluggen29-Oct-14 10:53
professionalEddy Vluggen29-Oct-14 10:53 
Questionc#.net desktop application Deployment issue Pin
aarav1234529-Oct-14 7:55
aarav1234529-Oct-14 7:55 
AnswerRe: c#.net desktop application Deployment issue Pin
Pete O'Hanlon29-Oct-14 8:25
mvePete O'Hanlon29-Oct-14 8:25 
GeneralRe: c#.net desktop application Deployment issue Pin
aarav1234529-Oct-14 8:29
aarav1234529-Oct-14 8:29 
GeneralRe: c#.net desktop application Deployment issue Pin
OriginalGriff29-Oct-14 9:13
mveOriginalGriff29-Oct-14 9:13 
QuestionOld famous problem. Access to Form1 from other namespace Pin
Member 1115157129-Oct-14 5:37
Member 1115157129-Oct-14 5:37 
QuestionRe: Old famous problem. Access to Form1 from other namespace Pin
Richard MacCutchan29-Oct-14 5:53
mveRichard MacCutchan29-Oct-14 5:53 
AnswerRe: Old famous problem. Access to Form1 from other namespace Pin
Dave Kreskowiak29-Oct-14 5:53
mveDave Kreskowiak29-Oct-14 5:53 
GeneralRe: Old famous problem. Access to Form1 from other namespace Pin
Member 1115157130-Oct-14 22:06
Member 1115157130-Oct-14 22:06 
GeneralRe: Old famous problem. Access to Form1 from other namespace Pin
Dave Kreskowiak31-Oct-14 7:44
mveDave Kreskowiak31-Oct-14 7:44 
AnswerRe: Old famous problem. Access to Form1 from other namespace Pin
Pete O'Hanlon29-Oct-14 5:54
mvePete O'Hanlon29-Oct-14 5:54 
SuggestionRe: Old famous problem. Access to Form1 from other namespace Pin
Richard Deeming29-Oct-14 6:46
mveRichard Deeming29-Oct-14 6:46 
GeneralRe: Old famous problem. Access to Form1 from other namespace Pin
Member 1115157130-Oct-14 22:08
Member 1115157130-Oct-14 22:08 
GeneralRe: Old famous problem. Access to Form1 from other namespace Pin
Member 1115157130-Oct-14 4:19
Member 1115157130-Oct-14 4:19 
GeneralRe: Old famous problem. Access to Form1 from other namespace Pin
Pete O'Hanlon30-Oct-14 4:29
mvePete O'Hanlon30-Oct-14 4:29 
GeneralRe: Old famous problem. Access to Form1 from other namespace Pin
Member 1115157130-Oct-14 5:42
Member 1115157130-Oct-14 5:42 
GeneralRe: Old famous problem. Access to Form1 from other namespace Pin
Pete O'Hanlon30-Oct-14 5:44
mvePete O'Hanlon30-Oct-14 5:44 
GeneralRe: Old famous problem. Access to Form1 from other namespace Pin
Member 1115157130-Oct-14 6:29
Member 1115157130-Oct-14 6:29 
GeneralRe: Old famous problem. Access to Form1 from other namespace Pin
Pete O'Hanlon30-Oct-14 7:05
mvePete O'Hanlon30-Oct-14 7:05 
The issue here is that you are creating a new instance of Form1 in your Changelabel method. So, you have one instance of the form which allows the user to press the button. They then press it and it creates an instance of ClassTEST. In that class, you create a new instance of Form1 and you call LabelText on that new instance (which won't be visible because you aren't showing it). If you want to work with the original instance, you're going to have to change a couple of things:
C#
public void Changelabel(Form1 form)
{
  form.LabelText = "text";
}
and
C#
private void button1_Click(object sender, EventArgs e)
{
  new ClassTEST().ChangeLabel(this); // "this" is a keyword that identifies the current instance.
}

GeneralRe: Old famous problem. Access to Form1 from other namespace Pin
Member 1115157130-Oct-14 10:18
Member 1115157130-Oct-14 10:18 
AnswerRe: Old famous problem. Access to Form1 from other namespace Pin
OriginalGriff29-Oct-14 6:01
mveOriginalGriff29-Oct-14 6:01 
GeneralRe: Old famous problem. Access to Form1 from other namespace Pin
Member 1115157130-Oct-14 22:10
Member 1115157130-Oct-14 22:10 
QuestionBound DataGridView with unbound text box column Pin
Nigel Mackay28-Oct-14 23:54
Nigel Mackay28-Oct-14 23:54 
AnswerRe: Bound DataGridView with unbound text box column Pin
Eddy Vluggen29-Oct-14 9:51
professionalEddy Vluggen29-Oct-14 9:51 

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.