Click here to Skip to main content
15,891,136 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: Print on Thermal Printing Pin
Goutam Patra4-Sep-10 1:51
professionalGoutam Patra4-Sep-10 1:51 
QuestionProblem Sending an Email from Desktop App Pin
All Time Programming2-Sep-10 22:31
All Time Programming2-Sep-10 22:31 
AnswerRe: Problem Sending an Email from Desktop App Pin
DaveAuld2-Sep-10 22:54
professionalDaveAuld2-Sep-10 22:54 
GeneralRe: Problem Sending an Email from Desktop App Pin
All Time Programming2-Sep-10 23:11
All Time Programming2-Sep-10 23:11 
GeneralRe: Problem Sending an Email from Desktop App Pin
DaveAuld3-Sep-10 0:34
professionalDaveAuld3-Sep-10 0:34 
GeneralRe: Problem Sending an Email from Desktop App Pin
All Time Programming3-Sep-10 0:32
All Time Programming3-Sep-10 0:32 
GeneralRe: Problem Sending an Email from Desktop App Pin
DaveAuld3-Sep-10 0:34
professionalDaveAuld3-Sep-10 0:34 
QuestionHow to change bool flag status on the main windows mobile form by pressing button on the other windows mobile form Pin
acont1-Sep-10 22:27
acont1-Sep-10 22:27 
When I run my application I am initializing some boolean flags - all of them are set to false at the begining, then just before the Load function ends - I am enabling another windows form full of buttons which are meant to be changing the flag statuses depending on which button the user presses. So when user presses the button on the second form - it run the function which is supossed to change flag status on the first form and after that it closses second form.

The thing is, that the flag status is not being changed, so if I want to set this flag status to true, it's all the time false. I don't know why. Below is the example code:

// declaration of values
private bool isFirstActive;
private bool isSecondActive;
private bool isThirdActive;

//splash screen form
private SplashScreen splashScreen;

//second menu form
private SecondMenu secondForm;

// initialization in constructor
public MainForm()
{
//show the splash screen to the user while loading
splashScreen = new SplashScreen();
splashScreen.Owner = this;
splashScreen.Show();

Application.DoEvents();

this.Enabled = false;

InitializeComponent();
isFirstActive = false;
isSecondActive = false;
isThirdActive = false;
}

private void MainForm_Load(object sender, EventArgs e)
{
//enable the main form
this.Enabled = true;
this.Visible = true;

//close the splash screen
splashScreen.Close();

//enable the second form
secondForm = new FacultyMenu();
secondForm.Owner = this;
secondForm.ShowDialog();
}

So now the user will see second form with some buttons, below the code for the second form with example button click:

private MainForm firstForm;

public SecondMenu()
{
firstForm = new MainForm();
InitializeComponent();
}

private void btnChangeSecond_Click(object sender, EventArgs e)
{
firstForm.changeSecondFlag();
Close();
}

So when user press the button, it will call the following method on the first form:

public void changeSecond()
{
isFirstActive = false;
isSecondActive = true;
isThirdActive = false;
}

Then it's closing the second form and goes back to the main form. but the isSecondActive valuse is still false.

Why?
AnswerRe: How to change bool flag status on the main windows mobile form by pressing button on the other windows mobile form Pin
Eddy Vluggen2-Sep-10 9:12
professionalEddy Vluggen2-Sep-10 9:12 
Questioni am asking for answers and not lectures from you guys Pin
imak31-Aug-10 7:21
imak31-Aug-10 7:21 
AnswerAlmost a repost - please ignore Pin
dan!sh 31-Aug-10 8:21
professional dan!sh 31-Aug-10 8:21 
GeneralRe: Its not a repost but a bit more specific questoin let me explain Pin
Richard MacCutchan31-Aug-10 12:00
mveRichard MacCutchan31-Aug-10 12:00 
GeneralRe: Its not a repost but a bit more specific questoin let me explain Pin
imak31-Aug-10 20:30
imak31-Aug-10 20:30 
AnswerRe: i am asking for answers and not lectures from you guys PinPopular
Tom Deketelaere31-Aug-10 22:06
professionalTom Deketelaere31-Aug-10 22:06 
AnswerRe: Read winform control properties via reflection Pin
dan!sh 31-Aug-10 8:20
professional dan!sh 31-Aug-10 8:20 
QuestionSOLVED - Secure the Software [modified] Pin
All Time Programming31-Aug-10 0:05
All Time Programming31-Aug-10 0:05 
AnswerRe: Secure the Software Pin
dan!sh 31-Aug-10 1:01
professional dan!sh 31-Aug-10 1:01 
GeneralRe: Secure the Software Pin
All Time Programming31-Aug-10 3:27
All Time Programming31-Aug-10 3:27 
GeneralRe: Secure the Software Pin
dan!sh 31-Aug-10 5:13
professional dan!sh 31-Aug-10 5:13 
AnswerRe: Secure the Software Pin
Eddy Vluggen31-Aug-10 8:37
professionalEddy Vluggen31-Aug-10 8:37 
AnswerRe: Secure the Software Pin
Expert Coming31-Aug-10 20:31
Expert Coming31-Aug-10 20:31 
AnswerRe: Secure the Software Pin
All Time Programming2-Sep-10 22:16
All Time Programming2-Sep-10 22:16 
Questiondatagridview cell color Pin
jogisarge27-Aug-10 8:27
jogisarge27-Aug-10 8:27 
AnswerRe: datagridview cell color Pin
Dave Kreskowiak27-Aug-10 10:45
mveDave Kreskowiak27-Aug-10 10:45 
AnswerRe: datagridview cell color Pin
Eddy Vluggen30-Aug-10 9:09
professionalEddy Vluggen30-Aug-10 9:09 

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.