Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Gillingham, Kent, England
    Posts
    511
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do a I make a form invisible (VB6)

    I have a form (orderLine) that a user can add lines to an order.
    I have since put in a function on the main form (orderHeader) that will add a discount to each line added. It does this by opening the form and running all of the necessary bits.

    However, I don't want the user to see this. I was sure there was a way to disable painting or something, and I tried setting .visible on the form but it didn't work. Does anyone have any idea how I can open and programmatically edit the form without actually displaying it?

    Any help, tips or links would be much appreciated, thanks.

    Regards

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How do a I make a form invisible (VB6)

    You can use

    Load FormName

    to load the form into memory and make it available for manipulation without displaying it. You can display it later on using

    FormName.Show

    or unload it from memory using

    Unload FormName

  3. #3
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Gillingham, Kent, England
    Posts
    511
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How do a I make a form invisible (VB6)

    I'll see if I can get it working using just that. Currently I have code in the activate event, which is kicked off when the .show is run (the form is already pre-loaded and has code independant of the code in the activate event). I'll see if I can move it around and use public variables to determine if the code needs to run or not. I'll post back when I've done that.

    Thanks for the suggestion Hans.

  4. #4
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Gillingham, Kent, England
    Posts
    511
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How do a I make a form invisible (VB6)

    Excellent it worked, thanks for that Hans.

    Due to the way the form was loaded before it was used, and then had things running on the show event, I simply took the show event code out and put it in a module so it could be ran with or without actually showing the form.
    The whole lot now gets automated when applying bulk discounts without the need for me to re-write a large portion of code, and without the form showing.

    Thanks again, regards,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •