I'm in C# on Mobile 5 and I need to know if I'm in DesignMode. The
DesignMode bool doesn't seem to be supported in the Compact Framework.
TIA,
Jim

Re: How to tell if you're in DesignMode in Compact framework? by Simon

Simon
Fri Jul 21 04:59:30 CDT 2006

Use the conditional compilation syntax for example:

#if DESIGN
MessageBox.Show("Design mode.");
#else
MessageBox.Show("Runtime mode.");
#endif

Regards
Simon.

"Jim McGhee" <JimMcGhee@discussions.microsoft.com> wrote in message
news:FE599939-117B-4CCF-AE44-1CBC8AB36A01@microsoft.com...
> I'm in C# on Mobile 5 and I need to know if I'm in DesignMode. The
> DesignMode bool doesn't seem to be supported in the Compact Framework.
> TIA,
> Jim



Re: How to tell if you're in DesignMode in Compact framework? by JimMcGhee

JimMcGhee
Fri Jul 21 10:58:01 CDT 2006

Hi Simon,
I must be missing something.
Are you saying that there are automatically two versions of a program
generated? One for design and one for runtime?
Thanks,
Jim

"Simon Hart" wrote:

> Use the conditional compilation syntax for example:
>
> #if DESIGN
> MessageBox.Show("Design mode.");
> #else
> MessageBox.Show("Runtime mode.");
> #endif
>
> Regards
> Simon.
>
> "Jim McGhee" <JimMcGhee@discussions.microsoft.com> wrote in message
> news:FE599939-117B-4CCF-AE44-1CBC8AB36A01@microsoft.com...
> > I'm in C# on Mobile 5 and I need to know if I'm in DesignMode. The
> > DesignMode bool doesn't seem to be supported in the Compact Framework.
> > TIA,
> > Jim
>
>
>

Re: How to tell if you're in DesignMode in Compact framework? by Ilya

Ilya
Fri Jul 21 16:34:30 CDT 2006

For NETCF V1 you have to use separate design time assemblies so it would
work.

For NETCF V2 you could use the following (assuming 'this' is a Component):

if ((this.Site != null) && this.Site.DesignMode) {
// Design mode
}

--
Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).

"Jim McGhee" <JimMcGhee@discussions.microsoft.com> wrote in message
news:9C858466-CEBC-49C0-86FE-465347F493D2@microsoft.com...
> Hi Simon,
> I must be missing something.
> Are you saying that there are automatically two versions of a program
> generated? One for design and one for runtime?
> Thanks,
> Jim
>
> "Simon Hart" wrote:
>
>> Use the conditional compilation syntax for example:
>>
>> #if DESIGN
>> MessageBox.Show("Design mode.");
>> #else
>> MessageBox.Show("Runtime mode.");
>> #endif
>>
>> Regards
>> Simon.
>>
>> "Jim McGhee" <JimMcGhee@discussions.microsoft.com> wrote in message
>> news:FE599939-117B-4CCF-AE44-1CBC8AB36A01@microsoft.com...
>> > I'm in C# on Mobile 5 and I need to know if I'm in DesignMode. The
>> > DesignMode bool doesn't seem to be supported in the Compact Framework.
>> > TIA,
>> > Jim
>>
>>
>>



Re: How to tell if you're in DesignMode in Compact framework? by JimMcGhee

JimMcGhee
Fri Jul 21 17:54:02 CDT 2006

Yesss!
This works!
Thanks Ilya, this was just what I needed.
My lack of experience with the compact framework is showing. I didn't
realize that previous versions required two versions of a control.
You learn something every day, if you're not carefull!
Thanks again,
Jim

"Ilya Tumanov [MS]" wrote:

> For NETCF V1 you have to use separate design time assemblies so it would
> work.
>
> For NETCF V2 you could use the following (assuming 'this' is a Component):
>
> if ((this.Site != null) && this.Site.DesignMode) {
> // Design mode
> }
>
> --
> Best regards,
>
> Ilya
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> *** Want to find answers instantly? Here's how... ***
>
> 1. Go to
> http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
> 2. Type your question in the text box near "Search this group" button.
> 3. Hit "Search this group" button.
> 4. Read answer(s).
>
> "Jim McGhee" <JimMcGhee@discussions.microsoft.com> wrote in message
> news:9C858466-CEBC-49C0-86FE-465347F493D2@microsoft.com...
> > Hi Simon,
> > I must be missing something.
> > Are you saying that there are automatically two versions of a program
> > generated? One for design and one for runtime?
> > Thanks,
> > Jim
> >
> > "Simon Hart" wrote:
> >
> >> Use the conditional compilation syntax for example:
> >>
> >> #if DESIGN
> >> MessageBox.Show("Design mode.");
> >> #else
> >> MessageBox.Show("Runtime mode.");
> >> #endif
> >>
> >> Regards
> >> Simon.
> >>
> >> "Jim McGhee" <JimMcGhee@discussions.microsoft.com> wrote in message
> >> news:FE599939-117B-4CCF-AE44-1CBC8AB36A01@microsoft.com...
> >> > I'm in C# on Mobile 5 and I need to know if I'm in DesignMode. The
> >> > DesignMode bool doesn't seem to be supported in the Compact Framework.
> >> > TIA,
> >> > Jim
> >>
> >>
> >>
>
>
>