-
i made this program that opens up graphics so u can see them without having to open up adobe or such other big programs ...
well, i manage to do this by opening the pic with the common dialog box once my program is loaded...
but my problem is how to open up my prog n load the picture ... get me?
i associated my program with bmp's but when i open a bmp up n my program starts up it doesn't load the graphic ... how do i go about doing this?
-
Try this...
You say you already associated your program with BMP's, and when you open a BMP file, your program loads. Well, you're through with the hard part. Now the easy part!
In the opening routine (Form_Load, Sub Main or whatever) put this code:
Code:
Dim sFileName As String
' We may get an error in the LoadPicture...
' Because sFileName may not be a supported file type (or maybe not even a filename)
' So, we use the nifty On Error Resume Next statement:
On Error Resume Next
sFileName = Trim(Command)
If Len(sFileName) > 0 Then
' If we get here, that means a BMP or whatever opened this program.
' sFileName is (maybe?) the filename of the BMP.
' You should add some code here which will open sFileName in your PictureBox. Example:
Set MyPictureBox.Picture = LoadPicture(sFileName)
End If
That should be it! Good luck with your program.
-
thanks
hey thanks for that code ... it worked well ... the only way it was easy for me to associate my program with bmp's was because i did it on my system ... i didn't do it by programming ... but like i said ... thanks for your help