Welcome to MSDN Blogs Sign in | Join | Help

Visual Studio For Devices

A Team blog from the Visual Studio for Devices Team

Syndication

Code Snippet for ChooseContactDialog

Below is the source for the ChooseContactDialog that I mentioned during my webcast on SqlMobile development. To use this snippet save it to a text file called "ChooseContactDialog.snippet" and put it in your My Documents\Visual Studio 2005\VB\My Code Snippets folder.

<?xml version="1.0" encoding="UTF-8"?>
<CodeSnippets xmlns="
http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
  <Header>
   <Title>Choose Contact Dialog</Title>
   <Shortcut>ChooseContactDialog</Shortcut>
   <Description>Code snippet for the Windows Mobile ChooseContactDialog</Description>
   <Author>Microsoft Corporation</Author>
   <SnippetTypes>
    <SnippetType>Expansion</SnippetType>
   </SnippetTypes>
  </Header>
  <Snippet>
      <References>
        <Reference>
          <Assembly>Microsoft.WindowsMobile.Forms.dll</Assembly>
        </Reference>
    <Reference>
     <Assembly>Microsoft.WindowsMobile.PocketOutlook.dll</Assembly>
    </Reference>
      </References>
      <Imports>
        <Import>
          <Namespace>Microsoft.WindowsMobile.Forms</Namespace> 
        </Import>
    <Import>
     <Namespace>Microsoft.WindowsMobile.PocketOutlook</Namespace>
    </Import>
      </Imports>
        <Declarations>
    <Literal>
     <ID>title</ID>
     <Default>"Select a Contact"</Default>
     <ToolTip>The title for the dialog</ToolTip>
    </Literal>
   </Declarations>
   <Code Language="VB" Kind="method body">
    <![CDATA[        Dim contactPicker As New Microsoft.WindowsMobile.Forms.ChooseContactDialog
        contactPicker.ChooseContactOnly = True  ' Change this to false to display the property picker
        contactPicker.Title = $title$

        If (contactPicker.ShowDialog() <> Windows.Forms.DialogResult.OK) Then
            ' Handle the cancel case here
        End If

        ' Handle the ok case here.]]>
   </Code>
  </Snippet>
 </CodeSnippet>
</CodeSnippets>

Published Wednesday, June 29, 2005 12:57 PM by MobileDevGroup

Filed under:

Comments

# The Mobile Minute 100 @ Sunday, July 03, 2005 12:00 PM

&amp;nbsp;Wooo Hooo!&amp;nbsp;&amp;nbsp; TMM 100.&amp;nbsp; Thought I&amp;rsquo;d never get here at the rate I post &amp;lt;g&amp;gt;;...

Nino.Mobile

New Comments to this post are disabled
Page view tracker