Problems with Message and the window that creates it

Post

Posted
Rating:
#1 (In Topic #942)
Enthusiast
gambafeliz is in the usergroup ‘Enthusiast’
 Problems with Message and the window that creates it.

I explain it:

I have an initial Form, it loads (launches) another form in front of it (called F1), Now this F1 form launches a Message with a request for a response. But what happens to me is that the F1 form is hidden and only the Initial Form + the Message remains. I want everything to look like this: Initial form and above it the F1 form and above it the Message. This is possible? Or do I have to create a question and answer system statically in the F1 form and thus have all the control myself.

For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Guru
cogier is in the usergroup ‘Guru’
Try putting Me.Show before you open F1 and again before displaying the Message.
Online now: No Back to the top

Post

Posted
Rating:
#3
Guru
BruceSteers is in the usergroup ‘Guru’
I assume you are using the message command in the form.open event?

That won't work as the form.must open first.

Best way is to create a timer and start it in the form open event.

Have the timer event use the message command and form.open can continue to work

Code (gambas)

  1. Public sub Form_Open()
  2. hTimer = New Timer As "Ttimer"
  3. hTimer.Delay = 0
  4. hTimer.Start
  5.  
  6. Public Sub Ttimer_Timer()
  7. Wait 0.1 ' might not need this line but a Wait can help.
  8. Message.Question("question")
  9.  
  10.  
Online now: No Back to the top

Post

Posted
Rating:
#4
Enthusiast
gambafeliz is in the usergroup ‘Enthusiast’
 Thank you both, I greatly appreciate your help.

I don't know if I should apologize or not. Because I think I have explained it very badly. I apologize just in case. Forgiveness.

I am programming in the IDE and I am not explaining something that happens in an executable program.

So situate yourselves, I'm in the IDE and I do F5

1. Load the FMain.
2. The FMain loads a Form called form1
3. The form1 launches Message to ask with two Yes or No buttons

And right there the form1 disappears and only the IDE and Message remain on the screen but the FMain and form1 are lost from the screen

My question:
Is this normal in the programming environment?
Does this also happen to me if I make the program executable without using the IDE?
Should I dialogue with the user with a personal development instead of Message to avoid these little problems?

Thank you and I hope I have explained it better than before.

For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
Online now: No Back to the top

Post

Posted
Rating:
#5
Guru
BruceSteers is in the usergroup ‘Guru’
 No that's your coding.
Nothing should hide form automatically.

If form hides it's your code.

Post an example program.
Online now: No Back to the top

Post

Posted
Rating:
#6
Enthusiast
gambafeliz is in the usergroup ‘Enthusiast’

BruceSteers said

No that's your coding.
Nothing should hide form automatically.

If form hides it's your code.

Post an example program.

As is normal for you, you are right friend BruceSteers

I have tried with ShowModal(), I always use Show() and it has fixed the problem. And also the graphical user interface now seems more solid and serious for the user.

Goodness :)

Hey seriously I wish you a nice day. Thanks.

For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
Online now: No Back to the top

Post

Posted
Rating:
#7
Avatar
Guru
cogier is in the usergroup ‘Guru’
I assume you are using the message command in the form.open event?

That won't work as the form.must open first.

Best way is to create a timer and start it in the form open event.

Have the timer event use the message command and form.open can continue to work

Code (gambas)

  1. Public sub Form_Open()
  2. hTimer = New Timer As "Ttimer"
  3. hTimer.Delay = 0
  4. hTimer.Start
  5.  
  6. Public Sub Ttimer_Timer()
  7.  
  8. Wait 0.1 ' might not need this line but a Wait can help.
  9. Message.Question("question")
  10.  

You could simplify this a little using the Trigger command: -

Code (gambas)

  1. Public Sub Form_Open()
  2.  
  3.   Dim hTimer As Timer
  4.  
  5.   hTimer = New Timer As "Timer1"
  6.   hTimer.Trigger
  7.  
  8.  
  9. Public Sub Timer1_Timer()
  10.  
  11.   Message.Question("question")
  12.  
Online now: No Back to the top

Post

Posted
Rating:
#8
Enthusiast
gambafeliz is in the usergroup ‘Enthusiast’
Thank you very much cogier

For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
Online now: No Back to the top

Post

Posted
Rating:
#9
Enthusiast
gambafeliz is in the usergroup ‘Enthusiast’
Hello, as I have already said, I have solved it with ShowModal, but is it possible to make the form open or change it to Modal or non-Modal on the fly? It would solve a big problem that I have. Thanks.

For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
Online now: No Back to the top

Post

Posted
Rating:
#10
Avatar
Regular
thatbruce is in the usergroup ‘Regular’

gambafeliz said

but is it possible to make the form open or change it to Modal or non-Modal on the fly?
<COLOR color="#FF0000">Not in this universe.</COLOR>
There are many things you can't change "on the fly" when using a GUI, the basic reason is that once the Gambas executable is "started" from your codes perspective it has already committed to a life long "partnership". Thus, you can't change the GUI, it's handlers, and many other things. But for future references you may care to look at the "Utility" property of your forms. (Actually, I'll be damned if I can work out what it does exactly, but it has caught me out more times than I care to admit.)
hth
b

Online now: No Back to the top

Post

Posted
Rating:
#11
Enthusiast
gambafeliz is in the usergroup ‘Enthusiast’
 I loved your comment, thank you. But although I would like to know about Form utilities, I don't know where to start if you don't give me something to start with, for example, a link.

Thanks, young man.

For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
Online now: No Back to the top
1 guest and 0 members have just viewed this.