Results 1 to 15 of 15

Thread: Probably a very simple question

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    2

    Question 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?

  2. #2
    Hyperactive Member Krass's Avatar
    Join Date
    Aug 2000
    Location
    Montreal
    Posts
    489

    Re: Probably a very simple question

    Why would you hide the form? Shouldn't you simply CLOSE it?
    Chris

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Probably a very simple question

    Welcome to the forums.

    Why are you trying to hide? Why don't you just unload it?

  4. #4
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    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.

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Probably a very simple question

    Quote 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.

  7. #7
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: Probably a very simple question

    Dont hide it just unload it. If you need that thing again then show it.

  8. #8
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    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.

  9. #9
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: Probably a very simple question

    Smux, you are getting way off the original problem. Just unload that thing.

  10. #10

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    2

    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.

  11. #11
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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.

  12. #12
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    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.

  13. #13
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Probably a very simple question

    Quote 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

  14. #14
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    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.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  15. #15
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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
  •  



Click Here to Expand Forum to Full Width