can anyone translate this into Latest VB Code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zaccy
    New Member
    • Jul 2007
    • 11

    can anyone translate this into Latest VB Code

    i am using visual basic
    the newest one
    and i need the coide to load a file from like a folder in my computer code in the old visual basic 6.0 it is like ::


    Randomize
    Select Case Int(Rnd * 6)+1

    Case 1
    picboxname.pict ure = LoadPicture(app .path & \picname.bmp)

    and so on
    but i need the code for the new version as this dont work
    thanx heaps
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #2
    Originally posted by Zaccy
    i am using visual basic
    the newest one
    and i need the coide to load a file from like a folder in my computer code in the old visual basic 6.0 it is like ::
    Randomize
    Select Case Int(Rnd * 6)+1
    Case 1
    picboxname.pict ure = LoadPicture(app .path & \picname.bmp)
    and so on
    but i need the code for the new version as this dont work
    thanx heaps
    [Code=VB]
    Select Case Int(Rnd * 6) + 1
    Case 1
    picboxname.pict ure = LoadPicture(app .path & "\picname.b mp")
    [/Code]
    It's not version problem.
    just try this(you missed the doubleuots).

    and can you explain why you calculating 6 and 1 with the Rnd method?

    [Code=VB]Int(Rnd * 6) + 1[/code]

    Comment

    • Zaccy
      New Member
      • Jul 2007
      • 11

      #3
      Originally posted by hariharanmca
      [Code=VB]
      Select Case Int(Rnd * 6) + 1
      Case 1
      picboxname.pict ure = LoadPicture(app .path & "\picname.b mp")
      [/Code]
      It's not version problem.
      just try this(you missed the doubleuots).

      and can you explain why you calculating 6 and 1 with the Rnd method?

      [Code=VB]Int(Rnd * 6) + 1[/code]
      the LoadPicture thingo dont work it says the name 'loadpicture' isnt declared
      plz tell me what can rplace it

      thanx

      Comment

      • hariharanmca
        Top Contributor
        • Dec 2006
        • 1977

        #4
        Originally posted by Zaccy
        the LoadPicture thingo dont work it says the name 'loadpicture' isnt declared
        plz tell me what can rplace it

        thanx

        then check is there picture which you declare in load picture method?

        Comment

        • Zaccy
          New Member
          • Jul 2007
          • 11

          #5
          Originally posted by hariharanmca
          then check is there picture which you declare in load picture method?
          yer i have and it says LoadPicture and App. names arent declared

          plz help

          Comment

          • Zaccy
            New Member
            • Jul 2007
            • 11

            #6
            PLEASE HELP i have this problem and i need it fixed
            all i need to know is the code to load pictures from folders in my computer when a number is equal to a case
            on the old one it is

            LoadPicture(App .Path & \1.bmp)

            but it doesnt work on new VB it says Name 'LoadPicture' is Not Declared and same with app.path
            plz help me
            PLEASE

            Comment

            • hariharanmca
              Top Contributor
              • Dec 2006
              • 1977

              #7
              Originally posted by Zaccy
              PLEASE HELP i have this problem and i need it fixed
              all i need to know is the code to load pictures from folders in my computer when a number is equal to a case
              on the old one it is

              LoadPicture(App .Path & \1.bmp)

              but it doesnt work on new VB it says Name 'LoadPicture' is Not Declared and same with app.path
              plz help me
              PLEASE
              [Code=VB]
              Select Case Int(Rnd * 6) + 1
              Case 1
              picboxname.pict ure = LoadPicture(app .path & "\picname.b mp")
              [/code]

              okay Zaccy, whatever the code is correct.

              now,
              1. try to copy the path from the 'Address' Bar in IE paste it
              2. then copy the file name and paste in in code with file extension.

              try this way.

              Comment

              Working...