Hi Guys,
I have a program that relies heavily on various Dll files. I have tried telling my users that these dll files need to be in the same directory as the exe, but they still seem to forget this.
I have added the required filenames to an array & created a msgbox for each one that isn't found. I'd like to make this look neater by having a splashscreen / 2nd form that loads before the main form. This contains labels & pictureboxes.
The labels (label1, label2, label3 etc) should be populated from the filename array & the pictureboxes (picturebox1, picturebox2, etc) should be populated with a tick or X.png depending on if the file is found.
I was trying to use a Do while loop to update the apropriate label & picturebox, but this:
produces errors.
I have found an article regarding this, but I'm new to VB.net & must admit am a bit lost, when reading it!
I would apreciate any help.
I have a program that relies heavily on various Dll files. I have tried telling my users that these dll files need to be in the same directory as the exe, but they still seem to forget this.
I have added the required filenames to an array & created a msgbox for each one that isn't found. I'd like to make this look neater by having a splashscreen / 2nd form that loads before the main form. This contains labels & pictureboxes.
The labels (label1, label2, label3 etc) should be populated from the filename array & the pictureboxes (picturebox1, picturebox2, etc) should be populated with a tick or X.png depending on if the file is found.
I was trying to use a Do while loop to update the apropriate label & picturebox, but this:
Code:
Me.label(i).Text = filename(i)
I have found an article regarding this, but I'm new to VB.net & must admit am a bit lost, when reading it!
I would apreciate any help.
Code:
Private Sub CheckingFiles_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim opentaskID As Double
Dim i As String
Dim filename(5) As String
Dim label(5) As String
Dim path As String = Directory.GetCurrentDirectory()
i = 0
filename(0) = "SAFileMgr.dll"
filename(1) = "Interop.ADODB.dll"
filename(2) = "Interop.FILEMGRLib.dll"
filename(3) = "Interop.MSDATASRC.dll"
filename(4) = "Interop.StdFormat.dll"
filename(5) = "Interop.stdole.dll"
Do While i < 5
' Me.label(i).Text = filename(i)
If File.Exists(path + "\" + filename(i)) = False Then
Dim cross As Image = Image.FromFile(Path + "\x.png")
Me.PictureBox1.Image = cross
Me.PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
Me.PictureBox1.Refresh()
Me.PictureBox1.Visible = True
MsgBox(filename(i) + Chr(13) + "This File Needs To Be In:" + Chr(13) + path, MsgBoxStyle.Critical, "File Not Found")
Application.Exit()
End If
i = i + 1
Loop
opentaskID = Shell("cmd /C regsvr32 SAFileMgr.dll /s", 0)
End Sub