Write and design friendly controls for Windows Mobile [writing designer friendly controls for Windows Mobile]

Source: Internet
Author: User

On j2i. net, I saw this article making designer friendly controls. The original Article is Simon Hart's writing designer friendly controls for Windows Mobile.

 

In the original article, when designing friendly controls for Windows Mobile, you must determine whether your code is running in the correct design, that is, whether your code is running on the desktop. If your mobile program runs on the desktop, you cannot call the DLL on the device.

"One thing that you sometimes need when writing Visual Studio designer friendly controls for Windows Mobile, is knowing if your code is running in design time-which is essential running on the desktop or not. you need to know this because if you are running on the desktop (design time) You don't want to call device specific DLLs."

 

The followingCodeYou can obtain the current mode:

DesignMode Public   Static   Class DesignMode
{
Private   Static   Byte _ Mode =   255 ;

Public   Static   Bool Istrue
{
Get
{
If (_ Mode =   255 )
_ Mode = Appdomain. currentdomain. friendlyname. Contains ( " Defaultdomain " ) ? ( Byte ) 1 :( Byte ) 0 ;
Return _ Mode =   1 ;
}
}
}

 

You can call

If (DesignMode. istrue)
{
// Don't call coredll. dll
}
Else
{
// Call coredll. dll
}

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.