Results 1 to 3 of 3
  1. #1
    Wealth is in the mind not the pocket.
    Premium Member
    Bitset's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Location
    M.I.A
    Posts
    254
    Reputation
    93
    Thanks
    1,704
    My Mood
    Buzzed

    Declare on other forms?

    Can anyone tell me how to declare items on different forms for example on Form 1 i do "Dim MeOn As Integer" or "Public MeOn As Integer"
    and I want that variable on Form 2 how would I declare that?

  2. #2
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Global scope, propriety, or pass it as a parameter to the new form constructor.
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  3. The Following User Says Thank You to 'Bruno For This Useful Post:

    Paul (11-28-2012)

  4. #3
    LilGho$t's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    419
    Reputation
    9
    Thanks
    330
    My Mood
    Twisted
    If it's public you can just say in form2:
    Code:
    sub Omg()
    msgbox(form1.MeOn).tostring
    end sub

Similar Threads

  1. [Help] Importing other form items?
    By MugNuf in forum Visual Basic Programming
    Replies: 5
    Last Post: 06-05-2010, 05:14 AM
  2. [TUT] How to go from one form to an other form [TUT]
    By mizzer3 in forum Visual Basic Programming
    Replies: 11
    Last Post: 01-13-2010, 04:22 AM
  3. Other private serv
    By terence in forum General
    Replies: 6
    Last Post: 12-26-2008, 12:14 PM
  4. IQ Test and other interesting tests!
    By Dave84311 in forum General
    Replies: 8
    Last Post: 01-09-2006, 06:39 AM