calling a subroutine at the beginnign
-
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
-
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
hi.. write your code in the
Form_Load()
event.. make sure that AutoRedraw property of the picture control is set to true -
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
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