Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am new in VB.NET. I wanted to create an application using the same techniques in VB 6.0. For my surprise the forms objects are controled differently.

 

this is my code:

--------------------------------------

 

Imports System.Data

Imports System.Data.SqlClient

Imports System

Imports Microsoft

 

 

 

Public Class Cypher

Inherits System.Windows.Forms.Form

 

Private Sub Cypher_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

 

 

End Sub

 

 

Private Sub mnu_newDoc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnu_newDoc.Click

 

frmNewDoc.Show()

End Sub

End Class

-------------------------

 

I have this error on the "show" method line ..... "reference to a non-shared member requires an object reference"

 

I am maybe missing a reference but I did not find any example that shows something about this reference. I am waiting for some books of VB.NET but in the mean time I will apreciate your comments.

 

Thanks

Posted

You must create a new variable of the type you are trying to use. C# example:

Form - the type which is a class.

Form f=new Form(); - f, a new instance of type Form.

f.Show(); - I show and use f not Form.

C#
Posted

thanks

 

Thanks guys,

 

I am working on a project with databases in VB.NET, which book do you recomend ? I found one from Evangelous Petroutsos. Let me know if you know a better one.

 

Thanks again

 

Jose Reyes

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...