Work around for KB839202 "DesigmMode property .... is always false"



Hi,

The following text is describing an alternative to the DesignMode
property as work around for KB839202.

I have Win Form application that is using an app.config. Into
app.config I have placed extra Key "MyDesignMode" into appSettings
section.

<appSettings>
<add key="MyDesignMode" value="1" />
</appSettings>

Using code that is testing the existence of key in the App.config I
was able to determine whether I am in design or runtime mode:

object o =
System.Configuration.ConfigurationSettings.AppSettings["MyDesignMode"];
if (o == null)
{
// We are in design mode;
}

In design mode the key "MyDesignMode" from app.config is not
accessible and therefore the return value is 'null'.

This simple test I have placed in all my nested user control on all
required places (e.g. form constructor and Form_Load procedures), and
it has allowed me to work reasonable well without getting various
exceptions during my design.

Regards

Viliam Batka

.



Relevant Pages

  • Re: VS.NET 2003 using ASP.NET & VB.NET -- IDE design time problems?
    ... I'm finding that VS.NET ASP design to be virtually useless with web forms? ... I design my web form using Design mode, and when I switch to HTML mode I see ... DropDownList controls will sometimes become hidden in the IDE, ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • RE: code layout
    ... Whenever you go to the design mode for any reason, ... I agree that putting the file to VSS is an exteremly bad solution, ... go back to the html, then VS does not mess with the html. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: vs.net not allowing design mode, no errors present
    ... >>> far on the page the program a) won't let me go in to design mode in that ... it's sporatic with others b) once I try to go in to design ... >> Mikhail Arkhipov (Microsoft) ...
    (microsoft.public.vsnet.general)
  • Re: How to resize form in Design Environment
    ... environmet and save it, it just return to the small size. ... Do you mean you're maximizing the form by clicking the Maximize button in ... the form will not be maximized when in Design ... In the IDE when in Design mode, forms are always sized and positioned to ...
    (microsoft.public.vb.general.discussion)
  • Re: Creating templates for the calendar?
    ... I'd suggest that you watch the web cast. ... To get into design mode, choose Tools | Forms | Design a Form. ... Sue Mosher, Outlook MVP ... >> put a form into design mode and start playing with it. ...
    (microsoft.public.outlook.calendaring)