• Log in or sign up for an account here: https://www.sythe.org/login

My First Program [SOURCE]

LaRoCkO

Active Member
Joined
Jul 2, 2008
Sythe Gold
0
Messages
155
Just a basic picture viewer I made in Visual Basic 2008
Just started learning and it is amazing :)

Here is source ( Uploaded source so you guys can see how it is done and learn)
There is comments before each command.

Code:
Public Class ViewerForm

    Private Sub btnSelectPicture_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelectPicture.Click
        ' This command shows the open file dialog box.
        If ofdSelectPicture.ShowDialog = DialogResult.OK Then
            ' This command loads the picture into the picture box.
            picShowPicture.Image = Image.FromFile(ofdSelectPicture.FileName)
            ' Show the name of the file in the form's caption.
            Me.Text = "Picture Viewer(" & ofdSelectPicture.FileName & ")"
        End If

    End Sub

    Private Sub btnQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuit.Click
        ' This will close the picture viewer

        Me.Close()
    End Sub
End Class
 
This should really be in the .Net section. Post there and I'm sure you'll get people who'll understand it a little better. :P
 
Member of the Month Winner
Sythe's 10th Anniversary
This should really be in the .Net section. Post there and I'm sure you'll get people who'll understand it a little better. :P
Indeed.

It isn't terribly hard to understand though, regardless of what framework you use. The classes are named as such that it is obvious what is happening from just glancing.

.Net is excellent, yes. I would recommend trying to move to C#, though. While the VB syntax is easy for starters, once you get to know the C syntax you generally won't want to go back.
 
Just by looking at that code it seems they could also open any other type of file. You need some sort of filter.

No, It is filtered to JPEG, JPG, GIF, (Picture files..)
 
Thanks mate, where should this go in Visual Basic 6?
Sorry for the noob question.
 
Member of the Month Winner
Sythe's 10th Anniversary
Thanks mate, where should this go in Visual Basic 6?
Sorry for the noob question.
It is not written in Visual Basic 6.

It is written in Visual Basic 9 (2008).
 
Moved this thread to the wrong section, now I can't move it back... >__<
 
Runescape Gamblingrunescape gambling
Back
Top