Results 1 to 9 of 9

Thread: [RESOLVED] PictureBoxs loaded at runtime not showing up

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Posts
    172

    Resolved [RESOLVED] PictureBoxs loaded at runtime not showing up

    Code runs without erros, but the images aren't displaying. The first control in the array is visable.

    Am I missing something or doing anything wrong????


    VB Code:
    1. For i = 1 To UBound(DisplayTree())
    2.     Load Form1.Img1(i)
    3.     With Form1.Img1(i)
    4.         .Picture = LoadPicture(App.Path & "\bmps\" & DisplayTree(i).Icon & ".bmp")
    5.         .Top = DisplayTree(i).OffSetA * 500
    6.         .Left = DisplayTree(i).OffSetB * 3000
    7.         .Width = 2655
    8.         .Height = 975
    9.     End With
    10. Next i

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: PictureBoxs loaded at runtime not showing up

    What is DisplayTree(i).Icon ??? What value does it have when code is executed?
    Also highlighted numbers

    .Top = DisplayTree(i).OffSetA * 500
    .Left = DisplayTree(i).OffSetB * 3000

    look like too large to me...

  3. #3

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Posts
    172

    Re: PictureBoxs loaded at runtime not showing up

    The problem code is in the module: drawingclass .
    And the numbers in bold are actually too small at the moment.

    DisplayTree is the following user type
    VB Code:
    1. Type MasterObject
    2.     Builder_name As String 'name of the builder that builds the object,
    3.                             'add to description
    4.     Local_Tech As String  'What can be deployed from this station - con.s or ships
    5.                             'add to discription
    6.     Abilities_Text As String 'Abilities, plain and simple. like smallrip, repair
    7.                                 'add to description
    8.     Loadout As String       'add to description
    9.    
    10.     Description As String   'enough said
    11.    
    12.     Def As String           'turns required numbers on
    13.    
    14.     Pre As String           'defines what Def(s) are needed
    15.    
    16.     base_tech As String     'Normal starting tech Def bits
    17.    
    18.     no_dev_tech As String   'Abnormal starting tech Def bits for use with death match and other modes
    19.    
    20.     Id As String            'cheack to see if there are doubles, if there are it could cause problems
    21.    
    22.     Next_Id As String       'what the object upgreads to, carful if there are doubles of Id
    23.    
    24.     Group_Id As Integer     'group all objects on tabs according to this
    25.    
    26.     Icon As String          'use this image, is actually the entry modle in the .cvs files with an i in front
    27.    
    28.     nName As String         'enough said
    29.    
    30.     station As String       'starting station
    31.    
    32.     filetype As String      'which file the intry was read from
    33.    
    34.     OffSetA As String      'see OffSetB; Left in top to down mode and Top
    35.                             'for left to right
    36.    
    37.     OffSetB As String      'the number of steaps on the logest route from each
    38.                             'tech to base to determine the Y
    39.                             'position (tier might be a better word) of a
    40.                             'given tech.  This number will be used to determin
    41.                             'Top (y position, in top to bottom mode) or
    42.                             'Left (x position, in left to right mode) by
    43.                             'number times offset (which can be set by the
    44.                             'user for custability)
    45.                             'NOTE!!!!: Currently the shortest route to a given tech, Longest route too for me to figure out and it may workout in the end this way
    46.                            
    47.    
    48. End Type

    Heres the whole project, but the .bmps are 6 mb

  5. #5

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Posts
    172

    Re: PictureBoxs loaded at runtime not showing up

    Quote Originally Posted by MartinLiss
    You need to add .Visible = True
    That worked.

    I guess controls don't inherit all the properties of the previous control.

  7. #7
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: PictureBoxs loaded at runtime not showing up

    Yes, you are right. properties like Visible, Top, Left will not be inherited...
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  8. #8
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: PictureBoxs loaded at runtime not showing up

    Quote Originally Posted by ganeshmoorthy
    Yes, you are right. properties like Visible, Top, Left will not be inherited...
    No, actually Top and Left are inherited and unless you change them like Tontow did the Loaded control will be placed directly on top of the original one.

  9. #9
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: PictureBoxs loaded at runtime not showing up

    Oh, I see. Thanks...
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


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