please help me


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 8 of 8

Thread: please help me

  1. #1
    Join Date
    Feb 2007
    Posts
    5

    please help me

    dear all

    i am a newer VB learner, while studing i face wirh trivil but vital problem that caused to stop my progress so please help me as soon as possible

    i have read in many books that i've installed form the net that in order to make

    procedure i should chose Add procedure option from the Tools menu

    i have searched at my Tools menu for the Add procedure option but i have not

    find an option with such Add procedure name please help and tell me how to overcome such fital problem
    hence i am using Microsoft Visual Studio.net2003

  2. #2
    Join Date
    Dec 2004
    Posts
    163
    idea2,

    Although Add Procedure was available from the Tools menu in VB6, I don't recall ever seeing that option in the Visual Studio.Net 2003 IDE.

    The menus in VS.Net 2003 are customizable, so it might be possible to add such a menu item, but I don't have any personal experience doing that.

    To add a procedure, such as a function, in Visual Studio.Net 2003, first make sure that a code window is on the screen. Then type the function header into the code window. A good place to enter the function header is at the bottom of the code window, immediately before the End Class statement.

    Unless the function will be a public method, use the Private keyword to begin the function header.

    Follow the Private keyword with the Function keyword, followed by the name of the function.

    For example, to create a function named getFeet to convert meters to feet you might type the following function header:

    private function getFeet

    When you hit the Enter key, Visual Basic presents you with skeletal code for the function:

    Private Function getFeet()

    End Function

    At this point you could add any arguments that the function requires. For example, in order to convert meters to feet the function needs to be sent meters as an argument. You can add meters as an argument like this:

    Private Function getFeet (meters as single)

    When you place the cursor after the closing parenthesis and hit Enter, Visual Basic presents you with the function and argument list:

    Private Function getFeet(ByVal meters As Single)

    End Function

    Notice that Visual Basic adds the qualifier “ByVal” if you do not explicitly type it. Unless changed by the programmer, Visual Basic passes arguments by value. (Previous versions of Visual Basic passed arguments by reference).

    You should also indicate the type of data returned by the function by placing the data type after the argument list in the function’s header:

    Private Function getFeet(ByVal meters As Single) As Single

    End Function

    Now you are ready to write code for the function. This function should convert meters to feet and return the answer in the name of the function, like this:

    Private Function getFeet(ByVal meters As Single) As Single

    'Convert meters to feet and return the result
    getFeet = meters * 3.28

    End Function

    Notice how you use the name of the function on the left-hand side of an assignment statement to return the answer in the name of the function.

    Another way to return the result is by using the Return keyword:

    Return meters * 3.28

    Kerry Moorman

  3. #3
    Join Date
    Feb 2007
    Posts
    5
    Thank you very much dear.

  4. #4
    Join Date
    Feb 2007
    Posts
    5
    now, i have faced wiht another problem while appling my program. i forund in some boox
    the following statement:
    if RadioButton1.Value = True Then
    myImage.Move(x,Y)
    actually value is not a propriety of RadioButton on the other hand its a propriety of other components..
    an error message states that Value is not a member of (system.Windows.Forms.RadioButton)
    now the question is what is the equivalent word that i can use instead of value
    please help me

  5. #5
    Join Date
    Dec 2004
    Posts
    163
    idea2,

    Use the radio button's Checked property.

    It appears that you are using VB6 books with Visual Basic 2005. This will cause you nothing but problems, as the 2 languages are very different.

    Kerry Moorman

  6. #6
    Join Date
    Feb 2007
    Posts
    5
    dear kmoorman

    could you please tell me, can i use the MS Visual studio.ner 2003 to work with the
    VB6??
    and what is the best software to use with VB6?
    please afford me..

  7. #7
    Join Date
    Dec 2004
    Posts
    163
    idea2,

    No, Visual Studio .Net 2003 works with Visual Basic .Net, not VB6.

    You need VB6, or Visual Studio to work with VB6.

    Personally, I would download the free Visual Basic 2005 Express Edition from Microsoft.

    But one thing is for sure, VB6 books won't have any code that will be of much use to you with .Net. You will only continue to confuse yourself if you don't use books that match your software.

    Kerry Moorman

  8. #8
    Join Date
    Feb 2007
    Posts
    5
    Thank you very much dear for ur feedback.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center