1 Attachment(s)
[RESOLVED] ERROR: Must have startup form or Sub Main()
Hello :)
I'm creating Picture Viewer and every time I click 'Preview' (Start), it says Must have startup form or Sub Main() :confused: then it opens a new window (Project Properties) :ehh:
http://vbforums.com/attachment.php?a...1&d=1183998683
Here's my code:
Code:
Private Sub Form_Load()
Left = (Screen.Width - Width) \ 2
Top = (Screen.Height - Height) \ 2
Combo1.Text = "All graphic files"
Combo1.AddItem "All graphic files"
Combo1.AddItem "All files"
End Sub
Private Sub Combo1_Change()
If ListIndex = 0 Then
File1.Pattern = ("*.bmp;*.wmf;*.jpg;*.gif")
Else
Fiel1.Pattern = ("*.*")
End If
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub DirSelect_Change()
File1.Path = Dir1.Path
File1.Pattern = ("*.bmp;*.wmf;*.jpg;*.gif")
End Sub
Private Sub DriveSelect_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
If Cmb1.ListIndex = 0 Then
File1.Pattern = ("*.bmp;*.wmf;*.jpg;*.gif")
Else
File1.Pattern = ("*.*")
End If
If Right(File1.Path, 1) <> "\" Then
filenam = File1.Path + "\" + File1.FileName
Else
filenam = File1.Path + File1.FileName
End If
Text1.Text = filenam
End Sub
Private Sub cmdShow_Click()
MMPlayer.FileName = Text1.Text
End Sub
Private Sub cmdShow_Click()
If Right(File1.Path, 1) <> "\" Then
filenam = File1.Path + "\" + File1.FileName
Else
filenam = File1.Path + File1.FileName
End If
Picture1.Picture = LoadPicture(filenam)
End Sub
What do I have to do? Please, help :(
Re: ERROR: Must have startup form ot Sub Main()
Go to Project|<your project> Properties and change the Startup Object to the form you want to start with.
Re: ERROR: Must have startup form ot Sub Main()
Ah... I created new form before this one and it was empty :p I had to delete it. Thanks anyway.