Extending ComboBox

Posts   
 
    
MarcoP avatar
MarcoP
User
Posts: 270
Joined: 29-Sep-2004
# Posted on: 15-Oct-2004 01:47:12   

I'm extending the combobox control and in the constructor, I am performing a fetch to populate my items collection. The problem is, when I drag my control on the form, I get an exception, because the designer calls the controls constructor. Does anyone know if there is a way to check if executing in design time or runtime?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39826
Joined: 17-Aug-2003
# Posted on: 15-Oct-2004 10:01:54   

I'm no design time expert but I recall something with the Site property of the component: you can read that to check if you;'re in design mode or not.

Frans Bouma | Lead developer LLBLGen Pro
MarcoP avatar
MarcoP
User
Posts: 270
Joined: 29-Sep-2004
# Posted on: 15-Oct-2004 14:05:03   

Nice, thanks man!

Fishy avatar
Fishy
User
Posts: 392
Joined: 15-Apr-2004
# Posted on: 15-Oct-2004 16:16:09   
 #If DEBUG Then
Public Class MDIFormBase
#Else
    Public MustInherit Class MDIFormBase
#End If

I use the above on my base form so the form design works correctly in the ide. I think you could do something similar for your constructor.