Results 1 to 4 of 4

Thread: Variables to use in many forms!

  1. #1
    Join Date
    Feb 2009
    Posts
    10

    Variables to use in many forms!

    Hi,

    I want some of the variables to use in different forms & not creating new & separate variables for each form of vb.net application!
    Is this possible? How?

  2. #2
    Join Date
    May 2008
    Posts
    63

    re: Variables to use in many forms!

    To declare a variable for all forms you have to declare it as Public.
    Just write Public instead of Dim.
    For Example:
    Public txt$
    Then you can access the txt variable form everywhere in the application.

    To load a text from a textfile:

    Open Textfilename for Input as #1
    Text1.text = Input(Lof(1), 1)
    Close #1

    This is really fast and puts all the content of the file into a textbox

  3. #3
    Join Date
    May 2008
    Posts
    40

    re: Variables to use in many forms!

    U declare the variable as a global variable.

    Make it a Public or Friend property (or member variable...but usually Property is better).

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    re: Variables to use in many forms!

    Hi
    Best way to access variables in outside form

    you can declare variables in module.
    by default module variables as public so you can access these variables entire project.

Similar Threads

  1. State variables in ASP.net
    By Athreya in forum Software Development
    Replies: 3
    Last Post: 12-01-2011, 01:15 PM
  2. What are the Predefined Variables in PHP?
    By Leonard in forum Software Development
    Replies: 5
    Last Post: 27-02-2010, 11:44 PM
  3. What are the PHP Variables?
    By shivendra in forum Software Development
    Replies: 5
    Last Post: 28-01-2010, 07:05 PM
  4. Constant Variables in C++
    By Gomeler in forum Software Development
    Replies: 3
    Last Post: 19-11-2009, 09:11 AM
  5. Forms In C#.net
    By sagngh88 in forum Software Development
    Replies: 1
    Last Post: 19-05-2009, 08:09 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,261,183.38152 seconds with 17 queries