Results 1 to 7 of 7

Thread: About a variable public in instance

  1. #1

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,966

    About a variable public in instance

    i'm using visual basic 6, in uC section....
    i have a groupproject with a control.
    in a module i build a type variable and a variable public:
    Code:
    Type Objects
        ObjectsNumber As Long
        ObjectName As String
        ObjectSelected As Boolean
    End Type
    
    Public lstObjectsNames() As Objects
    why these variable isn't only public in instance(i think that is the right term), but in intire object?
    for example: i have 2 sprites in a form, when i my property page(these variable isn't a property, but is in a property page) i can see(in both objects, the same value)...
    why these?
    can i put these variable in a property?
    thanks
    VB6 2D Sprite control

    To live is difficult, but we do it.

  2. #2
    Junior Member
    Join Date
    Dec 2006
    Posts
    29

    Re: About a variable public in instance

    Hi,

    Could you make it more clear? with example or some thing. I have not understood the question really speaking.

  3. #3

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,966

    Re: About a variable public in instance

    Quote Originally Posted by mbshinde78
    Hi,

    Could you make it more clear? with example or some thing. I have not understood the question really speaking.
    hi...
    i'm sorry, but i'm portuguese....
    control is a group of instances(various controls with same type), right?
    my problem is: i have created that variable(because i don't know how put it in a property) why that varible have the same value in every instances?
    thanks
    VB6 2D Sprite control

    To live is difficult, but we do it.

  4. #4

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,966

    Re: About a variable public in instance

    can i create a public variable in UC(but in a module)?
    (but these variable must be private in instance)
    thanks
    VB6 2D Sprite control

    To live is difficult, but we do it.

  5. #5

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,966

    Re: About a variable public in instance

    if i want create an public variable in UC(but in module), what adivices can anyone give me?
    the best way is a class?
    thanks
    VB6 2D Sprite control

    To live is difficult, but we do it.

  6. #6
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: About a variable public in instance

    You can just put the values in the Initialize event of your class so per instantiation they would have the same default values...
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  7. #7

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,966

    Re: About a variable public in instance

    Quote Originally Posted by dee-u
    You can just put the values in the Initialize event of your class so per instantiation they would have the same default values...
    thanks... but for my UC(for don't use class's) i will use a property/method....
    anotherthing: i try use(without sucess) option private module in a module, but what these line do(i don't have sure if the line is right write, but i think that you understand what i mean)?
    thanks
    VB6 2D Sprite control

    To live is difficult, but we do it.

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