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. [Message Deleted]

[Message Deleted]

Scheduled Pinned Locked Moved Visual Basic
5 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.
  • X Offline
    X Offline
    xfitr2
    wrote on last edited by
    #1

    [Message Deleted]

    C D 2 Replies Last reply
    0
    • X xfitr2

      [Message Deleted]

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Does ctl exist at this point ? Does it need to be initialised ? Christian Graus - Microsoft MVP - C++

      1 Reply Last reply
      0
      • X xfitr2

        [Message Deleted]

        D Offline
        D Offline
        DA_Loring
        wrote on last edited by
        #3

        Garrett Klas wrote:

        Private sub Example() Dim ctl as ctlExample Dim iFontSize as integer iFontSize = ctl.Fontsize <-- Throws Object/Variable not set Error End Sub

        ctl is not initialised. All you have done is reference it. You need Dim ctl as new ctlExample, or a Set ctl = new ctlExample at the start of the routine. Having said that, the control, assuming it is a User Control, should be sited on a form. Just accessing the control in the manner you show probably won't do anything as it would be creating a new instance of the control and I am not sure where it would be. You really need to access the control where it is sited i.e. 'Form1.ctlExample.FontSize = x' again assuming that you have a property called FontSise exposed in the control. -- modified at 6:19 Thursday 10th November, 2005

        X 1 Reply Last reply
        0
        • D DA_Loring

          Garrett Klas wrote:

          Private sub Example() Dim ctl as ctlExample Dim iFontSize as integer iFontSize = ctl.Fontsize <-- Throws Object/Variable not set Error End Sub

          ctl is not initialised. All you have done is reference it. You need Dim ctl as new ctlExample, or a Set ctl = new ctlExample at the start of the routine. Having said that, the control, assuming it is a User Control, should be sited on a form. Just accessing the control in the manner you show probably won't do anything as it would be creating a new instance of the control and I am not sure where it would be. You really need to access the control where it is sited i.e. 'Form1.ctlExample.FontSize = x' again assuming that you have a property called FontSise exposed in the control. -- modified at 6:19 Thursday 10th November, 2005

          X Offline
          X Offline
          xfitr2
          wrote on last edited by
          #4

          [Message Deleted]

          D 1 Reply Last reply
          0
          • X xfitr2

            [Message Deleted]

            D Offline
            D Offline
            DA_Loring
            wrote on last edited by
            #5

            OK, I hope I am understanding you correctly. Al you need to do is to set the variable in the class to the font size. You do not need to reference the control at all. [In Class Pane] Public FontSize As Integer etc [In User Control] strIndex = Panes.Add(??? variables if you have them) Panes(strIndex).FontSize = UserControl.FontSize I don't have VB6 with me but if this doesa not help can ive you a fuller example tomorrow. -- modified at 3:09 Friday 11th November, 2005

            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