Form won't display in design mode - Object reference not set

  • Thread starter Thread starter Jeff Molby
  • Start date Start date
J

Jeff Molby

I'm quite experienced with ASP.Net, so I know the language pretty well, but
this is my first significant windows app in VB.Net, so I haven't encountered
many of the quirks yet. I'm using VB 2003.

The form in question compiles perfectly and the application runs. However, I
cannot view the design page of the form, only the code page. This just
cropped up today. I've heard rumors of the Form_Load event being involved,
but I haven't found anything helpful.

Anyone come across this? Let me know what code might be helpful and I'll
post it.

BTW, it inherits from a base form that I created to house some standard
routines.

Thanks for any and all help!
 
Hi Jeff,

I was thinking and thinking about what would be the problem, but I think I
got it. You are used to a seperate form and code. In windows form the code
and the page are the same. Not y.aspx and y.vb but only x.vb.

So push on that form.vb in the solution explorer and the windowform should
show up. (When you set the solution explorer to show all files you will see
behind the x.vb a x.resx, when you take it not to strict you can compare
that with the x.aspx)

The load event works almost the same as with a webform, but there is of
course no "ispostback".

Cor
 
* "Jeff Molby said:
I'm quite experienced with ASP.Net, so I know the language pretty well, but
this is my first significant windows app in VB.Net, so I haven't encountered
many of the quirks yet. I'm using VB 2003.

The form in question compiles perfectly and the application runs. However, I
cannot view the design page of the form, only the code page. This just
cropped up today. I've heard rumors of the Form_Load event being involved,
but I haven't found anything helpful.

Anyone come across this? Let me know what code might be helpful and I'll
post it.

BTW, it inherits from a base form that I created to house some standard
routines.

If it's not too much code, you may post the code of your form.
 
It is all in one file, I guess I'm just using the wrong terminology. "Design
View" and "Code View" would probably be more appropriate, right?
 
there is quite a bit of code, but I will post the Load event from both
forms.

Here is the link that got me thinking it might involve the Load event
http://www.dotnet247.com/247reference/msgs/21/109402.aspx

Private Sub frmInventory_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim uom As InventoryBO.UnitsOfMeasurement
Dim vend As InventoryBO.Vendors

uom = New UnitsOfMeasurement
With uom
.ConnectionString = CONNECT_STRING
.SelectFilter = InventoryDC.UnitsOfMeasurementDC.SelectFilters.ListBox
.OrderByFilter =
InventoryDC.UnitsOfMeasurementDC.OrderByFilters.Description
.Open()
End With

Me.cbxSalesUOM.SetDataSource(uom)
Me.cbxPurchaseUOM.SetDataSource(uom)
uom = Nothing


vend = New Vendors
With vend
.ConnectionString = CONNECT_STRING
.SelectFilter = InventoryDC.VendorsDC.SelectFilters.ListBox
.OrderByFilter = InventoryDC.VendorsDC.OrderByFilters.Name
.Open()
End With

Me.cbxVendorNumPri.SetDataSource(vend)
vend = Nothing
End Sub


Private Sub frmDataClassBase_Load(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MyBase.Load
Dim dc As PDSADAL.IPDSADataClassRW
Dim arg As New DataFormCurrentRecordEventArgs
Dim dt As PDSADAL.TableData

RaiseEvent GetTables()
RaiseEvent GetLookups()

For Each dt In hshTables
Call DisplayRecord(dt)
Next
End Sub
 
On Thu, 20 Nov 2003 14:27:14 -0500, Jeff Molby wrote:


When you get the error, do you get a big red X across the form designer?
 

I get a similar problem on a new install of VS.Net 2003. ON any project
when I attempt to open the form designer, I get the big red X and a
NullReferenceException. I can add controls etc. to the form through code
and the program will run just fine, I just can use the designer.

So far, no one has offered any possible causes (or solutions). If I could
determine what the NullReferenceException was occuring on, it might help,
but I cannot.

Alas!
 
Even on new blank forms? That's strange. VS03 has worked fine for me up
until the other day. The other forms in the project still work fine. It's
just this one that's giving me fits.
 
Hi Jeff,

That is often with that error (I understood what it was when I saw it about
that cross).
Sometimes you only have to restart for that.

But I am glad you tell it to us, because I was looking for a solution for
you.

Cor



Jeff Molby said:
I have no idea what I did to fix it. Oh well...

well,
 
Hi Jeff,

Now I know what it was,
just unselect it from your IDE and select it again in your solution
explorer.

(for the next time)

:-)

Cor
 
I give up... everything works fine, so I'll just workaround it. I'm sure
it'll start working again before long.
Cor said:
Hi Jeff,

That is often with that error (I understood what it was when I saw it about
that cross).
Sometimes you only have to restart for that.

But I am glad you tell it to us, because I was looking for a solution for
you.

Cor
 
Back
Top