Results 1 to 18 of 18

Thread: .hide function and VB6

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Posts
    23

    .hide function and VB6

    I am doing some coding in VB and it is my understanding that there is a .show and a .hide function which would show and hide a form respectively. The .show appears to work, but the .hide does not. I get the following error:

    Compile Error: Method or data member not found

    I am running Visual Basic 6 service pack 6.

    Any help would be appreciated.

    Thank you.

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: .hide function and VB6

    VB Code:
    1. Form1.Hide
    Works for me...

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Posts
    23

    Re: .hide function and VB6

    Quote Originally Posted by Joacim Andersson
    VB Code:
    1. Form1.Hide
    Works for me...
    .show is in the drop down list, but .hide is not. Is there any way to add it. I have VB6 installed on both my workstation and laptop and neither have the .hide function.
    Business Manager / Founder
    HyTek Hosting, LLC
    www.hytekhosting.com

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: .hide function and VB6

    That's strange. Are you sure it is a form that you are trying to hide? Anyway you can always set the Visible property instead which is the same thing.
    VB Code:
    1. Form1.Visible = False

  5. #5
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: .hide function and VB6

    you might want to reinstall VB. sounds like something is mucked up.

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Posts
    23

    Re: .hide function and VB6

    Quote Originally Posted by dglienna
    you might want to reinstall VB. sounds like something is mucked up.
    They are both fresh installed on two separate computers. I tried re-installing on one of them and that made no difference...
    Business Manager / Founder
    HyTek Hosting, LLC
    www.hytekhosting.com

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Posts
    23

    Re: .hide function and VB6

    Actually, what I realized is that .hide now works but not for any of my forms in a project I was working on. If I add a new form within that project it does work. Any way I can fix this so that it works on all of the forms that I created previously?
    Business Manager / Founder
    HyTek Hosting, LLC
    www.hytekhosting.com

  8. #8
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: .hide function and VB6

    Is it possible for you to zip your project and upload it here so we can have a look at it?

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Posts
    23

    Re: .hide function and VB6

    Quote Originally Posted by Joacim Andersson
    Is it possible for you to zip your project and upload it here so we can have a look at it?
    Sure thing. I have attached it to this post.

    I am thinking that when I installed the service pack that it enabled the .hide function, but since this project was created prior to that, the forms have some old function list or something...
    Last edited by mysteryman; Feb 11th, 2005 at 03:44 PM.
    Business Manager / Founder
    HyTek Hosting, LLC
    www.hytekhosting.com

  10. #10

  11. #11
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: .hide function and VB6

    It has something to do with the Forms and how they were created. If you add a new Form1
    to the project and
    replace BankHome with Form1 as the startup object and add some buttons that do the same as
    the BankHome, it works and .Hide is available.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  12. #12

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Posts
    23

    Re: .hide function and VB6

    Quote Originally Posted by RobDog888
    It has something to do with the Forms and how they were created. If you add a new Form1
    to the project and
    replace BankHome with Form1 as the startup object and add some buttons that do the same as
    the BankHome, it works and .Hide is available.
    Yeah, I know. I think it is because the original VB did not have the .hide function and one of the service packs introduced it. The forms were created with the non-service pack version and new forms are created with the new functions all available. I just don't want to have to go back and re-create all of the forms in all of my projects that I am working on...
    Business Manager / Founder
    HyTek Hosting, LLC
    www.hytekhosting.com

  13. #13

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Posts
    23

    Re: .hide function and VB6

    Actually, the service pack did not add the .hide function. I just tried on a computer where I did not yet install the service pack and it had the .hide function when I created a new form. Same problem still exists though. The .hide function is not working/available in my current projects, but when new forms are added it is there...
    Business Manager / Founder
    HyTek Hosting, LLC
    www.hytekhosting.com

  14. #14
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: .hide function and VB6

    After being totally confused for some time I finally found the reason. Your main form is named BankHome but you have also named the label on this form to BankHome which confuses VB since the label doesn't have a Hide method. Simply give the label a different name and it works fine.

  15. #15
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: .hide function and VB6

    's and a few Reps on that one for Joacim!
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  16. #16

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Posts
    23

    Re: .hide function and VB6

    Thank you very much. That was stupid of me to name stuff the same.
    Business Manager / Founder
    HyTek Hosting, LLC
    www.hytekhosting.com

  17. #17
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: .hide function and VB6

    That's why most people use Hungerian notation when naming variables and objects. For example call a form frmBankHome and a label lblBankHome and so on.

  18. #18

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Posts
    23

    Re: .hide function and VB6

    Quote Originally Posted by Joacim Andersson
    That's why most people use Hungerian notation when naming variables and objects. For example call a form frmBankHome and a label lblBankHome and so on.
    Good idea. Thank you.
    Business Manager / Founder
    HyTek Hosting, LLC
    www.hytekhosting.com

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