CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2001
    Posts
    34

    Create sub main in a module

    My GUI had a button called cmdExport in Form1. I want to create a sub main that refer to this button.
    In a new module, I wrote :

    Sub Main()
    Form1.cmdExport
    End Sub

    However, when i try to make an .exe with Sub Main as the start up object, there's an error which refer to .cmdExport in Sub Main. The error message is 'Invalid use of property'.
    Can someone please help? Prompt answer will be much appreciated.

    Thank you.




  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Create sub main in a module

    'add the specification : .value = true
    ie:
    Sub Main()
    Form1.cmdCommand1.Value = True
    End Sub


    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
    and all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

    The Rater
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Jun 2001
    Posts
    34

    Re: Create sub main in a module

    Thanks a lot, Cimperiali !!

    Thanks...


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

Featured