Inheritance Problem

  • Thread starter Thread starter Martin
  • Start date Start date
M

Martin

Hi all,

I made a class which inherits system.windows.forms.form. I have put a lot of
standard functionality in this class, among others a call to a "label
handler" who reads the labels of all controls on the form from a database.

The reading of the database itself doesn't happen in this class, but in an
external handler, but this class calls the appropriate function of the
handler.

When I base my application forms on this class, the designer cannot open
them. I get a very scary window, which basically says that I am passing
arguments of the wrong type.

I narrowed it down to the recordset.open command, when I comment that
statement out, all works fine (but doesn't read anything of course).

I am getting the distinct impression that this code is executed in the
designer, which shouldn't happen of course (there is no connection at that
time). Run-time this label-handler works perfectly.
Am I right that this code is executed in the designer? And if so, is there a
way to suspend this?

Hope you can help me, I'm struggling with this for quite some time now.

Tia,
Martin
 
Ok, I found it!

What a relief...

In case someone else is struggling with a similar problem, here's the
solution:

If Not Me.Designmode Then
<<Offending Code>>
End If

Who knew that the solution could be this simple....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top