Results 1 to 3 of 3

Thread: object missing =\ code inside ...scan it forever =[

  1. #1

    Thread Starter
    Addicted Member Incures's Avatar
    Join Date
    May 2006
    Location
    south afrika
    Posts
    205

    object missing =\ code inside ...scan it forever =[

    Im sirrting aginst that code for 60min and its 8:00 am and i dident sleep =\
    i cant find what wrong!?@
    its says object missing ....and highlight that
    "Set Label.Container = Picturebox1"
    Code:
    Private Sub Form_Load()
    Dim Picutrebox As PictureBox
     'make the form pixels for easier drawing... doesn't have to be though
    Me.ScaleMode = vbPixels
    
    'draw picturebox
        Set PictureBox = Me.Controls.Add("VB.Picturebox", "Picturebox1")
          With PictureBox
                
                .Left = 1080 + 255 * 1
                .Top = 5040
                .Width = 500 * 2
                .Height = 500 * 2
                .Visible = True
                .BackColor = &H8000000F
        End With
          Dim Label As Label
    Set Label = Me.Controls.Add("VB.Label", "CMLabel1")
    
    Set Label.Container = Picturebox1
    With Label
                .Left = 0
                .Top = 0
                .Width = 500
                .Height = 500
                .Enabled = False
                .Visible = True
                .Caption = "345 X 345"
                
        End With
    End Sub
    and ... is it possible to check if ther is internet connection on the computer?
    which includes routers
    Last edited by Incures; Aug 14th, 2007 at 12:36 AM.
    vb Code:
    1. If(this post = helped you) then
    2. You.rate = me
    3. End if


    **Fazi's idea =]

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: object missing =\ code inside ...scan it forever =[

    Set Label.Container = Picturebox1
    should be
    vb Code:
    1. Set Label.Container = Me.Controls("picturebox1")
    or as the variable picturebox is still in scope, you could use
    vb Code:
    1. Set Label.Container = Picturebox
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3
    Frenzied Member
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,158

    Re: object missing =\ code inside ...scan it forever =[


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