.. _winforms-page:

###################################
|ProductName| with Windows Forms
###################################


.. image:: ../../images/net_logo.png
    :height: 64
    :align: right

|ProductName| has (on Windows) a built-in support for Win32 apps. This is implemented by the 
:class:`Win Component <cee::win::WinComponent>`. 
The same component is used for Win32, MFC, Windows Forms and WPF.

See the topic :ref:`c-sharp-users-page` for tips on how to use |ProductName| and this documentation with C#/.NET

*****************
Creating a Viewer
*****************

All HOOPS Envision apps needs a viewer in order to visualize the 3D data. Windows Forms uses the 
:class:`ViewerWin32 <cee::win::ViewerWin32>` found in the :class:`Win Component <cee::win::WinComponent>`. 

For integration towards Windows Forms, you create your own UserControl and implement paint, mouse and other event 
handling towards |ProductName|. A functional viewer with full code is provided in the WinFormsMinimal example. The 
WinFormsDemoApp offers more advanced integration features (like selection and rubberband).

****************
Example Programs
****************

All .NET examples are provided with a .cproj for use in Visual Studio.

**Windows Forms Minimal**

.. |img_wfm| image:: ../../images/example_winforms_minimal.png
   :width: 150

+-----------------------+------------------------------------------------------------------------------------+
| |img_wfm|             | **Location**\ : Examples/WinForms/WinFormsMinimal |br|                             |
|                       | A very small example showing the basic requirements for a Windows Forms |br|       |
|                       | application.                                                                       |
+-----------------------+------------------------------------------------------------------------------------+

**Windows Forms Report**

.. |img_wfr| image:: ../../images/rep_winformsreport.png
   :width: 150

+-----------------------+------------------------------------------------------------------------------------+
| |img_wfr|             | **Location**\ : Examples/WinForms/WinFormsReport |br|                              |
|                       | A very small example showing the basic functionality of the Report component.      |
+-----------------------+------------------------------------------------------------------------------------+


**Windows Forms DemoApp**

.. |img_wfdm| image:: ../../images/example_winforms_demoapp.png
   :width: 150

+-----------------------+------------------------------------------------------------------------------------+
| |img_wfdm|            | **Location**\ : Examples/WinForms/WinFormsDemoApp |br|                             |
|                       | A small Post Processor written in Windows Forms to showcase some of the |br|       |
|                       | features in the UnstructGrid component.                                            |
+-----------------------+------------------------------------------------------------------------------------+



