Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Changing properties of control in Class module

Changing properties of control in Class module

Scheduled Pinned Locked Moved Visual Basic
helpcsharpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mhovidz
    wrote on last edited by
    #1

    Hello to everyone! I have a problem about changing the properties of an object in a Class module. Before in Visual Basic 6 i used this code to change the properties a control

    Form1.Label1.Caption="...."

    Then how about VB.Net? Please help me...

    Mark Angelus V. Movida 3rd yr. BSCS St. Dominic Savio College

    J D 2 Replies Last reply
    0
    • M mhovidz

      Hello to everyone! I have a problem about changing the properties of an object in a Class module. Before in Visual Basic 6 i used this code to change the properties a control

      Form1.Label1.Caption="...."

      Then how about VB.Net? Please help me...

      Mark Angelus V. Movida 3rd yr. BSCS St. Dominic Savio College

      J Offline
      J Offline
      JackBradford
      wrote on last edited by
      #2

      Never used vb6, but I believe 'caption' has been replaced with '.text'? so... form1.label1.text = "...."

      M 1 Reply Last reply
      0
      • M mhovidz

        Hello to everyone! I have a problem about changing the properties of an object in a Class module. Before in Visual Basic 6 i used this code to change the properties a control

        Form1.Label1.Caption="...."

        Then how about VB.Net? Please help me...

        Mark Angelus V. Movida 3rd yr. BSCS St. Dominic Savio College

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        A class, unless it's the form itself, shouldn't care anything about any controls outside of it. This only worked in VB6 because, due to VERY bad practice, every form was visible to every piece of code in the app as a "global". This is, thankfully, no longer the case in VB.NET due to true OOP support. Your class should expose a status property that the form code can use to update itself. This class could even expose an event that the form could subscribe to so it get's a notification that the status has changed.

        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        1 Reply Last reply
        0
        • J JackBradford

          Never used vb6, but I believe 'caption' has been replaced with '.text'? so... form1.label1.text = "...."

          M Offline
          M Offline
          mhovidz
          wrote on last edited by
          #4

          Hello! Im trying to follow your code but! Theres no object appeared in the pop-up menu. I think theres only two (2) choices: (1) ActiveForm and (2) ControlCollection. But I don't know how to use that two properties. Thank you for helping me!

          Mark Angelus V. Movida 3rd yr. BSCS St. Dominic Savio College Philippines

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups