Thsi isnt working: If Me.DesignMode = True Then Return

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: moondaddy (moondaddy_at_nospam.com)
Date: 02/10/05


Date: Thu, 10 Feb 2005 10:31:52 -0600

I have a user control (uc2)which lives on another user control (uc1) on a
form (a nested user control). When I open the form in design view the the
load even fires in uc2 so the first line of code in the in its load event
is:

If Me.DesignMode = True Then Return

However, it doesnt work and code is still executing after this line. The
last line of code in the load event calls a private method which loads data
into a grid. This is the only place this private method gets called and
every time I open the form in design view I get a series of error beeps and
then I see data has loaded into the grid.

Any good advise on how to stop code from executing in design view?

Thanks.

-- 
moondaddy@nospam.com 


Relevant Pages

  • Re: Designer problem with inherited user control
    ... accepts components at design time. ... "FunctionView" from View where I want to add more components at design ... the derived user control does not accept components when they are ...
    (microsoft.public.dotnet.framework.windowsforms.designtime)
  • Re: User Control Instance/DataGridView.Columns in Visual Studio De
    ... simple user control and a form that hosts an instance ... The user control class contains a DataGridView instance ... then open the main form in design mode. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Load all tabpages when the tabcontrol load
    ... Although the Tab Page has no Load event, but all the user controls have the Load event, so when I put a user control on one of the tab page, the ... Load event of user control only called when the tab page becomes visible, ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: VB 2005 User Control Issue
    ... >> First of all there is a middle-tier object connected to the user control. ... >> Cor Ligthert, ... >>> It is bad design to mix up getting data from a server in an UI. ...
    (microsoft.public.dotnet.general)
  • Re: Problem with UserControl
    ... "Cowboy (Gregory A. Beamer)" wrote: ... information is missing (in Design, for example), do not load real data. ... that interact with the oracle database on Load event. ...
    (microsoft.public.dotnet.framework)