CONTENT
 PRODUCTS
 ARTICLES
 DOWNLOAD
 SOURCE CODE
 BOOK
 ABOUT
 HOME

MVP

ADS




Source Code for .NET Compact Framework
If you want source code for .NET Compact Framework, this is the place to look. We have provided some source code samples to make your Pocket PC application development easier.

Or you may be looking for source code for eMbedded Visual Basic.

This code is currently available:

 Check connection
 Edit menu
 Start another application
 8pt font on controls
 Scrollable form
 Grid in ListView


 
Check Connection (C#)
This is a sample that shows how to check the connection state in your applications. It is implemented using managed code only and the functionality is encapsulated in a reusable managed wrapper. The wrapper uses the the HTTP functionality in .NET (namespace System.Net) to try a request to a specified URL, and the wrapper also supports make multiple requests.

Please feel welcome to download the sample code.

Check Connection Sample


 
Edit Menu (C#)
This is a sample that shows how to implement Edit menu functionality in your applications. It makes calls to the native Windows API functions using the P(latform) Invoke functionality in .NET Compact Framework. The functionality is encapsulated in a reusable managed wrapper. The supported menu items are: Undo, Cut, Copy, Paste and Clear (the "Select all" option can easily be implemeted using managed code). Note that the sample also shows how to enable/disable the menu options.

Please feel welcome to download the sample code.

Edit Menu Sample


 
Start another application (C#)
This is a sample that shows how to start another application from your applications. It makes a call to the native Windows API function CreateProcess using the P(latform) Invoke functionality in .NET Compact Framework. The functionality is encapsulated in a reusable managed wrapper. The sample (see figure) starts Internet Explorer for Pocket PC with our home page loaded.

Please feel welcome to download the sample code.

Start Application Sample


 
8pt font on controls (C#)
This is a sample that shows how to set the font on the controls in a form to 8 points. It makes calls to the native Windows API functions using the P(latform) Invoke functionality in .NET Compact Framework. The functionality is encapsulated in a reusable managed wrapper (original credit goes to Alex Feinman). The wrapper also support changing font size on ListView controls.

Note also how the sample show you how to use a (1pt) panel to draw the top line that makes the form conform to the Pocket PC user interface design guidelines. Further, to make the user interface comply with other Pocket PC application (like Pocket Word and Pocket Excel) the labels should be 8pt while textboxes are 9pt. To make the label text align nicely with the text in the textbox, the label should be placed 4pt lower than the textbox.

Please feel welcome to download the sample code.

8pt Font Sample


 
Scrollable form (C#)
This is a sample that shows how to create a scrollable form in your applications. It is implemented using managed code only. It uses a panel to host the controls and a vertical scrollbar to handle the scrolling. Note that the sample include the resize of the form (and scrollbar) when the SIP is visible.

Please feel welcome to download the sample code.

Scrollable Form Sample


 
Grid in ListView (C# and VB.NET)
This is a sample that shows how to show gridlines in a ListView control in your applications. It makes calls to the native Windows API functions using the P(latform) Invoke functionality in .NET Compact Framework. The functionality is encapsulated in a reusable managed wrapper. Note that gridlines will not look good if you include column headers in the ListView (this is a problem with the native ListView control).

Please feel welcome to download the sample code.

ListView Grid Sample


©2001-2009 Christian Forsberg & Andreas Sjöström