Adblock breaks this site

My First Program [SOURCE]

Discussion in 'Archives' started by LaRoCkO, Aug 8, 2008.

  1. LaRoCkO

    LaRoCkO Active Member
    Banned

    Joined:
    Jul 2, 2008
    Posts:
    155
    Referrals:
    0
    Sythe Gold:
    0
    My First Program [SOURCE]

    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
    
     
  2. Darthatron

    Darthatron Massive Troll
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    May 22, 2006
    Posts:
    1,612
    Referrals:
    3
    Sythe Gold:
    0
    My First Program [SOURCE]

    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
     
  3. Swan

    Swan When They Cry...
    Retired Global Moderator

    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner
    My First Program [SOURCE]

    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.
     
  4. Covey

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816
    My First Program [SOURCE]

    Just by looking at that code it seems they could also open any other type of file. You need some sort of filter.
     
  5. LaRoCkO

    LaRoCkO Active Member
    Banned

    Joined:
    Jul 2, 2008
    Posts:
    155
    Referrals:
    0
    Sythe Gold:
    0
    My First Program [SOURCE]

    No, It is filtered to JPEG, JPG, GIF, (Picture files..)
     
  6. Flipmc

    Flipmc Member

    Joined:
    Aug 8, 2008
    Posts:
    60
    Referrals:
    0
    Sythe Gold:
    1
    My First Program [SOURCE]

    Thanks mate, where should this go in Visual Basic 6?
    Sorry for the noob question.
     
  7. Swan

    Swan When They Cry...
    Retired Global Moderator

    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner
    My First Program [SOURCE]

    It is not written in Visual Basic 6.

    It is written in Visual Basic 9 (2008).
     
  8. LaRoCkO

    LaRoCkO Active Member
    Banned

    Joined:
    Jul 2, 2008
    Posts:
    155
    Referrals:
    0
    Sythe Gold:
    0
    My First Program [SOURCE]

    yea what swan said
     
  9. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    My First Program [SOURCE]

    Moved this thread to the wrong section, now I can't move it back... >__<
     
< Selling lvl 33 mystic pure (with 76 wc) | Ohai der! >


 
 
Adblock breaks this site