Results 1 to 4 of 4

Thread: How to show the same item you doing throughout the whole app?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2008
    Posts
    22

    How to show the same item you doing throughout the whole app?

    I am doing an account editing application.
    I had like my applications to be doing on the same account, be it in my main form or in other forms (debit, credit, paymen etc), but still doing on the same account.

    So, how can I implement my form/code to be doing on the same account unless user selected other accounts, throughout the whole app?

    I heard and seen that arguements or methods in your coding, how do you do that?

  2. #2

  3. #3
    Addicted Member
    Join Date
    May 2008
    Posts
    232

    Re: How to show the same item you doing throughout the whole app?

    A module? Could you explain to me in detail how to do it?

    Sorry for the inconvenience caused.

  4. #4
    PowerPoster Deepak Sakpal's Avatar
    Join Date
    Mar 2002
    Location
    Mumbai, India
    Posts
    2,424

    Re: How to show the same item you doing throughout the whole app?

    Quote Originally Posted by melvados
    A module? Could you explain to me in detail how to do it?

    Sorry for the inconvenience caused.
    Sometimes you need to create functions that are of generic in nature. Lets say you need a function which should give you a random number between specified range. So you will create a function to generate a random number and put into a module. Once you write this function in a module, you will be able to call it from anywhere.

    A module is declared with Module, End Module pair. You don't need to create the object of the Module to call functions inside it. Here is some sample code:

    vb.net Code:
    1. ' Module code
    2. Module Module1
    3.  
    4.     Public Function GetRandomNumber( _
    5.         ByVal minValue As Integer, _
    6.         ByVal maxValue As Integer _
    7.     ) As Integer
    8.  
    9.         Dim RandomClass As New Random()
    10.         Return RandomClass.Next(minValue, maxValue)
    11.     End Function
    12.  
    13. End Module
    vb.net Code:
    1. ' Form code
    2. Public Class Form2
    3.  
    4.     Private Sub Form2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    5.         MessageBox.Show(GetRandomNumber(10, 20).ToString)
    6.     End Sub
    7.  
    8. End Class

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width