hide form
Posted
#1
(In Topic #895)
Enthusiast

For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you.
Posted
Guru

gambafeliz said
' hide a "Main" form
FMain.Hide
or
FMain.Visible = False
If you need to keep the data in the form alive then set the forms Persistent = True
If the window is not the Application main window then you can just use MyFormName.Close()
If window is not persistent then the fields will need to be filled on each load/open or if it is persistent then the fields will be filled/accessible even when form is hidden/closed
Posted
Guru

How you re-open the window (what your app does while the window is closed) is important to how you can close it.
Ie. if the window is re-opened by using a trayicon click or something then you could just use Me.Close and Me.Show as the application will not quit until you close your trayicon.
You can use Me.Close on the main application window as long as there is something keeping your program alive like a timer event, trayIcon, another open window or an open file handle, etc. (And the forms Persistent property is True)
Hope that makes sense
Posted
Enthusiast

But I don't know what happens in my application. "Hide" does not work and "Visible" does not work.
I do not understand why.
I describe what I have done. I had a main window, this has become just a window without more. And I have created a new Form that has taken as main.
And when I hide the main window to "show" the next one, "neither Hide nor Visible" works.
Why? no idea. maybe the order of the final Show?
Note: From my previous post, I have the feeling that my application is contaminated since I changed the main form for another.
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you.
Posted
Guru

The above mentioned code all works as expected for me here so there must be a glitch in your code somewhere keeping the window open or reopening it.
Post your project and we will soon get to the problem
Posted
Guru

Posted
Guru

Create new form (say it's name is MyForm) in your FMain.class
MyForm = New Form
Initialise new form and open it with
MyForm.Show()
then
FMain.Hide (or Me.Hide if the code is in FMain.class)
Posted
Enthusiast

Me = frmSetup (it is Main Form)
FMain = (It is no longer the main one) it is simply a Form that I call from frmSetup
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you.
Posted
Guru

post your project.
here's something that simply does what you are describing..
Posted
Enthusiast

But although your code is what I am looking for it is impossible for me to implement it in my project.
And I'm sorry to tell you that I don't want to share my project. It is something very personal.
I think for sure. That Gambas3 has messed up and I have broken the project. Because things like "Hide" and other things don't work. In any case, I will continue studying my problem and in the end I will tell you, what happened?
Thank you
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you.
Posted
Guru

you could remove everything except the window hide/show functions
If not, best of luck.
Posted
Enthusiast

Right now I have discovered, but I don't have the solution, that it is a recursion problem.
Where, I open a main window that detects that it should automatically open another window, but when this last window, I call the main window myself with a button, the main window detects the same thing and continues the cycle until it stays or in the second window or close, because I'm a mess myself.
How crazy, right?
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you.
Posted
Enthusiast

I think I've found the solution, although I'm still trying to get it to work.
First, it is not a problem of the wonderful Gambas3, I reaffirm myself, wonderful.
Second, it's my fault and mine alone. The problem is mainly that I lack knowledge, basically it is a knowledge problem on my part.
I have created a pseudocode in my language and when going through it, I have detected that everything is poorly developed. To the point that now FMain is again the start of the project and the Form for loading the database and the configuration is a form that will be called with Show and will be closed with Close, and nothing else.
At the moment I am implementing it, I will continue telling it in case this is a new design error on my part.
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you.
1 guest and 0 members have just viewed this.



