Click here to Skip to main content
15,913,934 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralSet Printer to Landscape mode in VB.Net Pin
Mr Magic20-Jul-05 9:38
Mr Magic20-Jul-05 9:38 
GeneralRe: Set Printer to Landscape mode in VB.Net Pin
Dave Kreskowiak20-Jul-05 12:27
mveDave Kreskowiak20-Jul-05 12:27 
GeneralRe: Set Printer to Landscape mode in VB.Net Pin
Mr Magic21-Jul-05 2:20
Mr Magic21-Jul-05 2:20 
GeneralAcess Form Function Pin
makeko20-Jul-05 7:41
makeko20-Jul-05 7:41 
GeneralRe: Acess Form Function Pin
Anonymous20-Jul-05 8:55
Anonymous20-Jul-05 8:55 
GeneralRe: Acess Form Function Pin
Anonymous20-Jul-05 9:16
Anonymous20-Jul-05 9:16 
GeneralRe: Acess Form Function Pin
makeko21-Jul-05 4:36
makeko21-Jul-05 4:36 
GeneralRe: Acess Form Function Pin
Anonymous21-Jul-05 5:20
Anonymous21-Jul-05 5:20 
makeko wrote:
Public Class Form2
Inherits System.Windows.Forms.Form

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fr1 As Form1
fr1.teste() ***
End Sub
End Class

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

*** ERROR: "An unhandled exception of type 'System.NullReferenceException' occurred in WindowsApplication3.exe

Additional information: Object reference not set to an instance of an object."


You made the same error...but this time you did not create an instance of Form1 in the Form2 button event.

You had:
Dim fr1 As Form1<br />
fr1.teste() ***


Where you should have
Dim fr1 As New Form1<br />
fr1.teste() ***


Also, please take the time to read this article, it may help you with your situation.
http://www.devcity.net/Articles/94/multipleforms.aspx[^]
GeneralRe: Acess Form Function Pin
makeko21-Jul-05 8:08
makeko21-Jul-05 8:08 
GeneralRe: Acess Form Function Pin
Anonymous21-Jul-05 9:00
Anonymous21-Jul-05 9:00 
GeneralRe: Acess Form Function Pin
makeko22-Jul-05 7:01
makeko22-Jul-05 7:01 
GeneralRe: Acess Form Function Pin
Anonymous22-Jul-05 10:38
Anonymous22-Jul-05 10:38 
GeneralRe: Acess Form Function Pin
makeko26-Jul-05 7:36
makeko26-Jul-05 7:36 
GeneralSQL Server Question Pin
spettiford20-Jul-05 7:41
spettiford20-Jul-05 7:41 
GeneralRe: SQL Server Question Pin
Dave Kreskowiak20-Jul-05 12:49
mveDave Kreskowiak20-Jul-05 12:49 
GeneralRe: SQL Server Question Pin
Christian Graus20-Jul-05 12:51
protectorChristian Graus20-Jul-05 12:51 
GeneralPrinter Independent in Visual Basic 6.0 (?) Pin
e_screw20-Jul-05 7:14
e_screw20-Jul-05 7:14 
GeneralRe: Printer Independent in Visual Basic 6.0 (?) Pin
Dave Kreskowiak20-Jul-05 12:47
mveDave Kreskowiak20-Jul-05 12:47 
GeneralMsi's waiting on finish Pin
phraser20-Jul-05 6:26
phraser20-Jul-05 6:26 
GeneralRe: Msi's waiting on finish Pin
rwestgraham20-Jul-05 15:51
rwestgraham20-Jul-05 15:51 
GeneralRe: Msi's waiting on finish Pin
phraser21-Jul-05 8:48
phraser21-Jul-05 8:48 
GeneralRe: Msi's waiting on finish Pin
rwestgraham22-Jul-05 14:14
rwestgraham22-Jul-05 14:14 
GeneralStoring Values in Enum Pin
prathiba_naresh20-Jul-05 5:55
prathiba_naresh20-Jul-05 5:55 
GeneralRe: Storing Values in Enum Pin
Christian Graus20-Jul-05 12:52
protectorChristian Graus20-Jul-05 12:52 
Generalvoice recognition Pin
Ms Damia20-Jul-05 5:08
sussMs Damia20-Jul-05 5:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.