Jump to content

Hiding Froms, and showing them again.


Guest alhabibam

Recommended Posts

Guest alhabibam

Can any one help me in how to show a form after hiding it.

I want to hide my application form, then the user can do whatever he/she wants with the mobile. Then I want my application to popup to the user with a timer tick.

I have tried form.Show(); , form.Visible = true; , and form.BringToFront(); but nothing worked...

Can any one tell how to do so...

Thanks.

Link to comment
Share on other sites

Guest vman69
Can any one help me in how to show a form after hiding it.

I want to hide my application form, then the user can do whatever he/she wants with the mobile. Then I want my application to popup to the user with a timer tick.

I have tried form.Show(); , form.Visible = true; , and form.BringToFront(); but nothing worked...

Can any one tell how to do so...

Thanks.

<{POST_SNAPBACK}>

You need to make sure that you have a local reference to the form that you have hidden. For instance have a private variable reference to the form and then from the caller you can call 'yourformName.Visible = true' when you are in that form and then close it using a close button or whatever make sure you call in that form this.Visible = false. This will make the form invisible but it will still be active in memory. So that in your other form that created it before can just call a 'yourformName.Visible=true' to make it appear again.

Other ways is have your parent form and create your child form in it call a form.Show() then in the child form call childForm.Close() to close it down so you can create it again.

I hope this has helped you out in someway or maybe even confused you even more.

Link to comment
Share on other sites

Guest alhabibam

I have tried these ways before, but nothing is working..

Once I hide the last form and the home screen of the mobile showup, It is not shown again whatever I do. I tried to make them visible again but nothing worked.

I hope that someone here know how to solve this problem...

Thanks.

Link to comment
Share on other sites

Guest mgama
I have tried these ways before, but nothing is working..

Once I hide the last form and the home screen of the mobile showup, It is not shown again whatever I do. I tried to make them visible again but nothing worked.

I hope that someone here know how to solve this problem...

Thanks.

<{POST_SNAPBACK}>

I posted a solution to this a while ago.

http://www.modaco.com/Hide_main_form_appli...in-t199561.html

The only thing you want to be careful of is interrupting something the user is doing, such as dialing 911, entering a new contact, playing a game, etc.

Edited by mgama
Link to comment
Share on other sites

Guest alhabibam

Thank you mgama

I have tried the solution you posted, but it didn't work with me..

I don't know why, but maybe I am doing something wrong. I need some clarifications from you about your solution.

When I want to hide the form, what should I use?? form.Hide() or form.Visible = false???????

What I am doing is that i set a timer that will show the form after a specific period, then I hide the form and the home screen appear. I expect that after that period of time I will see the form popping up... But it doesn't..

Another question is that can I put the code that show the form in the code of another form that use a reference to the first form????????

I need your help in this problem, and I really apreciate you effort.

Thanks.

Link to comment
Share on other sites

Guest mgama

I would use this.Hide()

I've attached some sample code, where the logic to hide & show the form all occurs in the same form.

The forum wouldn't let me attach .cs files, so I renamed it to .txt.

Form1.cs.txt

Edited by mgama
Link to comment
Share on other sites

  • 10 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.