Shadow Blade
Morrowland Presents Apron Tutorials
game - design - multimedia - web - programming - tutorials - There are currently viewers visiting Apron Tutorials.
   
 
TECHNICAL
GRAPHICAL
SOUND
GAME
WEB
ARTICLE
TOOL
PROJECT
 
 NEWS

  news

  history


 TECHNICAL TUTORIALS

  opengl

  direct3d

  c/c++

  visual basic

  java

  c#


 WEB TUTORIALS

  html

  dhtml

  asp

  php


 IMAGE EDITING

  photoshop

  draw sketch


 3D MODELING

  3d studio


 PROJECTS

  shadow blade

  game environment

  virtual 3d guide

  billy blue flame


 DEMOS

  win32 api


 ARTICLES

  general

  opengl


 COMMUNITY

  about us

  credit

  contact







VISUAL BASIC .NET APRON TUTORIALS






'Functions are different from procedures in Visual Basic
'because they must return a value.
'Here is two different ways to use functions...

Public Class Form1
    Inherits System.Windows.Forms.Form

    'Here is two different ways to use functions...

    Dim X As Integer

    'Part I''''''''''''''''''''''''''''''
    'uses a function without argument
    Private Function myFunc1()
        myFunc1 = X + 5        'add x with 5 and return value
    End Function

    Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click
        X = 5                  'set X = 5
        TextBox1.Text = myFunc1() 'write return value of the function myFunc1
    End Sub

    'END Part I''''''''''''''''''''''''''

    'Part II'''''''''''''''''''''''''''''
    'uses a function with argument
    Private Function myFunc2(ByVal Y As Integer)
        myFunc2 = Y + 5         'add Y with 5 and return value
    End Function

    Private Sub Button2_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button2.Click
        TextBox2.Text = myFunc2(5)   'write return value of the function myFunc2
    End Sub
    'END Part II'''''''''''''''''''''''''

End Class


Download The Source Code! Visual Basic .Net Source Code


I hope you found this VB .Net tutorial useful!

Don't forget to mention Apron Tutorials in your References!

Best Regards
Ronny André Reierstad

 LINKS

  morrowland home



 GAME DEVELOPEMENT

  nvidia

  gamedev

  polycount


 PROJECTS

  shadow blade

  game environment

  virtual 3d guide

  billy blue flame


 MATH AND PHYSICS

  mathworld

  physicsworld







PLEASE LINK TO


  All rights reserved Morrowland © 2011  
Ronny André Reierstad