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. calling a subroutine at the beginnign

calling a subroutine at the beginnign

Scheduled Pinned Locked Moved Visual Basic
questiontutorial
3 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.
  • N Offline
    N Offline
    NickOne
    wrote on last edited by
    #1

    hello, I am trying to learn how to call a subroutine at the beginning of a program, before anyone has to click on anything. I am writing a real simple unit conversion program, and I wanted to display this menu inside a picture box: pic_unitDisplay.Print "1. inch", "2. fathom", "3. foot" pic_unitDisplay.Print "4. furlong", "5. kilometer", "6. meter" pic_unitDisplay.Print "7. fathom", "8. rod", "9. yard" (oh yeah I am doingthis in VB 6) So I placed that in a subroutine called unitDisplay. If I call subroutine on any of the click, like a command button or anything, it'll pop up like I want. BUT I want it to pop up first, right at the beginning of the program. How do I call a subroutine right at the beginning of program execution? Thanks Nick

    H P 2 Replies Last reply
    0
    • N NickOne

      hello, I am trying to learn how to call a subroutine at the beginning of a program, before anyone has to click on anything. I am writing a real simple unit conversion program, and I wanted to display this menu inside a picture box: pic_unitDisplay.Print "1. inch", "2. fathom", "3. foot" pic_unitDisplay.Print "4. furlong", "5. kilometer", "6. meter" pic_unitDisplay.Print "7. fathom", "8. rod", "9. yard" (oh yeah I am doingthis in VB 6) So I placed that in a subroutine called unitDisplay. If I call subroutine on any of the click, like a command button or anything, it'll pop up like I want. BUT I want it to pop up first, right at the beginning of the program. How do I call a subroutine right at the beginning of program execution? Thanks Nick

      H Offline
      H Offline
      Hesham Amin
      wrote on last edited by
      #2

      hi.. write your code in the Form_Load() event.. make sure that AutoRedraw property of the picture control is set to true

      1 Reply Last reply
      0
      • N NickOne

        hello, I am trying to learn how to call a subroutine at the beginning of a program, before anyone has to click on anything. I am writing a real simple unit conversion program, and I wanted to display this menu inside a picture box: pic_unitDisplay.Print "1. inch", "2. fathom", "3. foot" pic_unitDisplay.Print "4. furlong", "5. kilometer", "6. meter" pic_unitDisplay.Print "7. fathom", "8. rod", "9. yard" (oh yeah I am doingthis in VB 6) So I placed that in a subroutine called unitDisplay. If I call subroutine on any of the click, like a command button or anything, it'll pop up like I want. BUT I want it to pop up first, right at the beginning of the program. How do I call a subroutine right at the beginning of program execution? Thanks Nick

        P Offline
        P Offline
        Paul Farry
        wrote on last edited by
        #3

        add a Sub Main module. then change your project preferences sub Main frmConevert.show vbModal,me end sub ---- sub Form_Load ' setup pic_unitDisplay.Print "1. inch", "2. fathom", "3. foot" pic_unitDisplay.Print "4. furlong", "5. kilometer", "6. meter" pic_unitDisplay.Print "7. fathom", "8. rod", "9. yard" end sub

        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