Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Classes in VB6

FirecoreFirecore Member Posts: 18
What exactly are class modules and how do we use them?

Comments

  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444
    : What exactly are class modules and how do we use them?
    :

    Class Modules are modules in which we define a class, which can be used to create Objects. I'm not really qualified to explain fully: read about Object Oriented Programming.
    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • dokken2dokken2 Member Posts: 532
    : : What exactly are class modules and how do we use them?
    : :
    :
    : Class Modules are modules in which we define a class, which can be
    : used to create Objects. I'm not really qualified to explain fully:
    : read about Object Oriented Programming.
    : Best Regards,
    : Richard
    :
    : The way I see it... Well, it's all pretty blurry


    its like a higher level of a structure. a class can define an object using properties [similar to subs/functions]. a class can also create its own events.
  • FirecoreFirecore Member Posts: 18
    : : : What exactly are class modules and how do we use them?
    : : :
    : :
    : : Class Modules are modules in which we define a class, which can be
    : : used to create Objects. I'm not really qualified to explain fully:
    : : read about Object Oriented Programming.
    : : Best Regards,
    : : Richard
    : :
    : : The way I see it... Well, it's all pretty blurry
    :
    :
    : its like a higher level of a structure. a class can define an
    : object using properties [similar to subs/functions]. a class can
    : also create its own events.

    Events? How do we do that?
  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444
    :
    : Events? How do we do that?
    :

    VB6:

    In Class1
    [code]
    Event Ticked()

    Sub DoTick()
    RaiseEvent Ticked
    End Sub
    [/code]

    In Form1
    - Create 1 command button
    - Create 1 label
    - Use default names for both (command1, label1)
    [code]
    Dim WithEvents tick As Class1

    Private Sub Command1_Click()
    tick.DoTick
    End Sub

    Private Sub Form_Load()
    Set tick = New Class1
    End Sub

    Private Sub tick_Ticked()
    Label1.Caption = Label1.Caption & " Tick! "
    End Sub
    [/code]

    Basic example.
    I'm affraid I don't know exactly how it's done with VB.NET.
    I believe there is a property for each event the Object has that can be set to point to a user specified function.

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • FirecoreFirecore Member Posts: 18
    I see.
    I think I get it now.
    TY for that

Sign In or Register to comment.