
here will be times when you'll need to hand-code your .NET Compact Framework controls, without using the drag-and-drop feature of Visual Studio .NET. For example, you may not know how many controls to create during design time, and thus during runtime you need to create them explicitly using code.
A good example is the use of a context menu. The options in a context menu may be obtained from a Web service, and so you need to dynamically create the context menu when the program is running.
In this article, I will show you how to create controls dynamically and how to "wire" them up to event handlers.

I need to create a control for my handheld application on the fly at runtime, without going back to the visual environment.

Hand-code your controls directly into your project and then connect them with event handlers.