|
-
Jun 1st, 2007, 11:30 AM
#1
Thread Starter
New Member
Probably a very simple question
I have a form that basically has just a label on it saying "Processing your request" that I want to pop up while (novel idea) it's processing a request. Before the request I show the form using "form.show vbmodal"
and when the processing is done on my main form I run: "form.hide"
But this doesn't hide the form. Am I missing something?
The only workaround I can think of is a bit kludgy. Making a global variable like FormShouldBeOpen as integer and running a timer on the popup to check and see if it should hide.
thoughts?
-
Jun 1st, 2007, 11:36 AM
#2
Hyperactive Member
Re: Probably a very simple question
Why would you hide the form? Shouldn't you simply CLOSE it?
-
Jun 1st, 2007, 11:36 AM
#3
Re: Probably a very simple question
Welcome to the forums. 
Why are you trying to hide? Why don't you just unload it?
-
Jun 1st, 2007, 11:39 AM
#4
PowerPoster
Re: Probably a very simple question
Do you use this "processing" form a lot...if so, ignore the others, you don't want to unload it.
I assume the form you are trying to hide is called "form", yes? Stupid question, but it's a valid point :-)
Others might know how vbmodal forms act when you try to hide them, but I've no idea...I'll have a quick play and see and will post in a min
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Jun 1st, 2007, 11:39 AM
#5
Re: Probably a very simple question
Welcome to VBForums 
The problem is simply that you are showing the form using vbModal - that means the rest of the code will not run until the other form is closed.
If you remove the vbModal , it should work as you want.
It is possible tho for the user to close the other form, so you may want to also set otherform.Enabled = False
-
Jun 1st, 2007, 11:42 AM
#6
Re: Probably a very simple question
 Originally Posted by smUX
Do you use this "processing" form a lot...if so, ignore the others, you don't want to unload it.
Forms not currently in use should be unloaded.
-
Jun 1st, 2007, 11:42 AM
#7
Re: Probably a very simple question
Dont hide it just unload it. If you need that thing again then show it.
-
Jun 1st, 2007, 11:43 AM
#8
PowerPoster
Re: Probably a very simple question
So in other words, using vbModal is useless anyway because it isn't even doing the processing it suggests it is doing :-)
sdk, you could try having the form "always on top" with the message....either with zorder or with an API which would make sure it's always on top of the form :-)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Jun 1st, 2007, 11:44 AM
#9
Re: Probably a very simple question
Smux, you are getting way off the original problem. Just unload that thing.
-
Jun 1st, 2007, 11:48 AM
#10
Thread Starter
New Member
Re: Probably a very simple question
Okay well let me try this. If I take off the modal property it works properly except when the form comes up I just see the title bar and the border. The actual form looks blank. Note: I am viewing this app through Remote Desktop. So I don't know for sure that that's how it actually looks on the screen.
-
Jun 1st, 2007, 11:53 AM
#11
Re: Probably a very simple question
You might need to throw a DoEvents into your code in case your label is not being refreshed.
I would check it out on the actual screen first though.
-
Jun 1st, 2007, 12:02 PM
#12
Re: Probably a very simple question
Yes, programming via remote desktop is laggy and sometimes annoying. I agree with Hack. Try it first on the actual screen.
-
Jun 1st, 2007, 12:48 PM
#13
Re: Probably a very simple question
 Originally Posted by zynder
Smux, you are getting way off the original problem. Just unload that thing.
If the code to unload it is in the form that loads it, it'll never unload, so smUX's comment was right on the money. You can't load a form modally and then unload it from the form that loaded it.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
Jun 1st, 2007, 01:08 PM
#14
Re: Probably a very simple question
I must be missing something. 
What's wrong with something like this ?
Code:
Option Explicit
Private Sub Command1_Click()
Me.Enabled = False
frmMsg.Show ', Me
DoProcessing
Unload frmMsg
Me.Enabled = True
End Sub
Private Sub DoProcessing()
'do your processing
End Sub
Last edited by iPrank; Jun 1st, 2007 at 01:22 PM.
Reason: commented unnecessary code.
-
Jun 1st, 2007, 01:12 PM
#15
Re: Probably a very simple question
That is basically what I was suggesting back in Post #3.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|