xtd.forms examples
August 19, 2025 ยท View on GitHub
This folder contains xtd.forms examples used by Reference Guide and more.
Hello Worlds
- hello_world_emoticons The classic first application "Hello, World!" with xtd::forms::emoticons component.
- hello_world_label The classic first application "Hello, World!" with xtd::forms::label control.
- hello_world_message_box The classic first application "Hello, World!" with xtd::forms::message_box control.
- hello_world_message_box2 The classic first application "Hello, World!" with xtd::forms::message_box control.
- hello_world_message_box3 The classic first application "Hello, World!" with xtd::forms::message_box control.
- hello_world_paint The classic first application "Hello, World!" with GDI+ drawing objects.
- hello_world_say The classic first application "Hello, World!" with xtd::forms::button control and xtd::speech::synthesis::speech_synthesizer class.
- hello_world_xtd The classic first application "Hello, World!" with xtd::forms::main_menu menu, xtd::sorms::status_bar control, and xtd::event_handler.
Application
- application shows how to create an application with xtd::forms::application class.
- application_and_assert shows how to create an application with xtd::forms::application class and hot to manage assert.
- application_and_exception shows how to create an application with xtd::forms::application class and hot to manage exception.
- application_context shows how to create an application with xtd::forms::application class.
- application_restart shows how to restart application with xtd::forms::application::restart method.
- application_use_wait_cursor shows how to show and hide wait cursor application with xtd::forms::application::use_wait_cursor method.
- application_thread_exception shows how to use xtd::forms::application::thread_exception event.
- application_with_cmake_assembly_info demonstrates the use of xtd::reflection::assembly attributes, xtd::forms::form classes.
- application_with_manual_assembly_info demonstrates the use of xtd::reflection::assembly attributes, xtd::forms::form classes.
Dialogs
- about_box represents a dialog box that displays about box.
- about_dialog represents a dialog box that displays about dialog.
- assert_box represents a dialog box that displays assert box.
- assert_dialog represents a dialog box that displays assert dialog.
- busy_box represents a busy box that displays busy box.
- busy_dialog represents a busy box that displays busy dialog.
- color_box represents a dialog box that displays available colors along with controls that enable the user to define custom colors.
- color_dialog represents a dialog box that displays available colors along with controls that enable the user to define custom colors.
- debug_message_box represents a debug message box that displays debug message box and write debug message.
- debug_message_dialog represents a debug message dialog that displays debug message dialog and write debug message.
- exception_box represents a exception box that displays exception box.
- exception_dialog represents a exception box that displays exception box.
- find_box represents a find dialog box.
- find_dialog represents a find dialog box.
- folder_browser_box prompts the user to select a folder.
- folder_browser_dialog prompts the user to select a folder.
- font_box represents a dialog box that displays a font box to the user to choose a font from among those installed on the local computer.
- font_dialog prompts the user to choose a font from among those installed on the local computer.
- input_box prompts the user to input text.
- input_dialog prompts the user to input text.
- message_box displays a message window, also known as a dialog box, which presents a message to the user. It is a modal window, blocking other actions in the application until the user closes it. A MessageBox can contain text, buttons, and symbols that inform and instruct the user.
- message_dialog displays a message window, also known as a dialog box, which presents a message to the user. It is a modal window, blocking other actions in the application until the user closes it. A MessageBox can contain text, buttons, and symbols that inform and instruct the user.
- open_file_box displays a file select window, also known as a file dialog, which asks the user to select a single or multiple files. It is a modal window, blocking other actions in the application until the user closes it.
- open_file_dialog displays a standard dialog box that prompts the user to open a file.
- progress_box displays a progress dialog window, which shows to user a progress animation, with more details like the remaining time, estimated time and other options which can be customized with xtd::forms::progress_box_options. It is a modal window, blocking other actions in the application until the user cancels or hides it.
- progress_dialog represents a progress box that displays progress box.
- replace_box represents a replace dialog box.
- replace_dialog represents a replace dialog box.
- save_file_box displays a file save window, also known as a file dialog, which asks the user to select a path to save a single file to. It is a modal window, blocking other actions in the application until the user closes it.
- save_file_dialog prompts the user to select a location for saving a file.
- trace_message_box represents a trace message box that displays trace message box and write trace message.
- trace_message_dialog represents a trace message dialog that displays trace message dialog and write trace message.
Forms
- debug_form represents a form that trace all written debug with xtd::diagnostics::debug class.
- dialog demonstrates the use of xtd::forms::form container as dialog.
- form represents a window or dialog box that makes up an application's user interface.
- popup_form demonstrates the use of xtd::forms::form container as popup form.
- trace_form represents a form that trace all written trace with xtd::diagnostics::trace class.
Menus and Toolbars
- context_menu represents a shortcut menu.
- context_menu_strip represents a shortcut menu.
- main_menu represents a main menu system for a form.
- menu_strip represents a menu system for a form.
- status_bar represents a Windows status bar control.
- status_strip represents a Windows status bar control.
- tool_bar represents a tool bar for a form.
- tool_strip represents a container for Windows toolbar objects.
- tool_strip_container represents panels on each side of the form and a central panel that can hold one or more controls.
Containers
- flow_layout_panel represents a panel that dynamically lays out its contents horizontally or vertically.
- collapsible_panel used to group collections of controls in a collapsible container.
- group_box represents a Windows control that displays a frame around a group of controls with an optional caption.
- horizontal_layout_panel used to group collections of horizontal aligned controls.
- panel demonstrates the use of xtd::forms::panel container.
- popup_panel demonstrates the use of xtd::forms::popup_panel container.
- split_container represents a control consisting of a movable bar that divides a container's display area into two resizable panels.
- tab_control manages a related set of tab pages.
- table_layout_panel represents a panel that dynamically lays out its contents in a grid composed of rows and columns.
- vertical_layout_panel used to group collections of horizontal aligned controls.
Controls
- animation represents a xtd::forms::animation control.
- bitmap_button demonstrates the use of xtd::forms::button control with xtd::drawing::image.
- button represents a Windows xtd::forms::button control.
- buttons Show how to use buttons factory with xtd::forms::buttons control.
- check_box represents a Windows xtd::forms::check_box control.
- check_boxes Show how to use check boxes factory with xtd::forms::check_boxes factory.
- checked_list_box represents a Windows control to display a list of check box.
- choice represents a xtd::forms::choice control.
- color_picker represents a Windows control that allows the user to select and display a color.
- combo_box represents a Windows xtd::forms::combo_boxcontrol.
- command_link_button represents a Windows xtd::forms::command_link_button control.
- control defines the base class for controls, which are components with visual representation.
- date_time_picker represents a Windows control that allows the user to select a date and a time and to display the date and time with a specified format.
- domain_up_down represents a Windows spin box (also known as an up-down control) that displays string values.
- dot_matrix_display represents a xtd::forms::fourteen_segment_display control.
- font_picker represents a Windows control that allows the user to select and display a font.
- fourteen_segment_display represents a xtd::forms::fourteen_segment_display control.
- h_scroll_bar represents a standard Windows horizontal scroll bar.
- label represents a standard Windows xtd::forms::label.
- lcd_label represents a xtd::forms::lcd_label control.
- light_button represents a xtd::forms::light_button control.
- link_label represents a Windows label control that can display hyperlinks.
- list_box represents a Windows control to display a list of items.
- list_view represents a Windows list view control, which displays a collection of items that can be displayed using one of four different views.
- loading_indicator represents a Windows control to display a loading indicator animation.
- loading_indicators represents a Windows control to display a loading indicator animation.
- masked_text_box uses a mask to distinguish between proper and improper user input.
- month_calendar specifies values for navigating among accessible objects.
- nine_segment_display represents a xtd::forms::nine_segment_display control.
- notify_icon specifies a component that creates an icon in the notification area. This class cannot be inherited.
- numeric_up_down represents a Windows spin box (also known as an up-down control) that displays numeric values.
- picture_box represents a Windows picture box control for displaying an image.
- progress_bar represents a Windows xtd::forms::progress_bar control.
- radio_button enables the user to select a single option from a group of choices when paired with other xtd::forms::radio_button controls.
- radio_buttons Show how to use radio buttons factory with xtd::forms::radio_buttons factory.
- rich_text_box represents a Windows rich text box control.
- seven_segment_display represents a xtd::forms::seven_segment_display control.
- sixteen_segment_display represents a xtd::forms::sixteen_segment_display control.
- splitter represents a splitter control that enables the user to resize docked controls. Splitter has been replaced by SplitContainer and is provided only for compatibility with previous versions.
- switch_button represents a xtd::forms::switch_button control.
- text_box represents a Windows xtd::forms::text_box control.
- tool_tip Represents a small rectangular pop-up window that displays a brief description of a control's purpose when the user rests the pointer on the control.
- toggle_button represents a xtd::forms::toggle_button control.
- toggle_buttons Show how to use toggle buttons factory with xtd::forms::toggle_buttons factory.
- track_bar represents a standard Windows xtd::forms::track_bar.
- tree_view displays a hierarchical collection of labeled items, each represented by a TreeNode.
- up_down_button represents a Windows spin button.
- user_control defines the base class for user controls.
- v_scroll_bar represents a standard Windows vertical scroll bar.
- web_browser enables the user to navigate Web pages inside your form.
Components
- application_settings represents settings application.
- background_worker executes an operation on a separate thread.
- button_images represents common images collection can be used for button.
- button_renderer show how to use xtd::forms::button_renderer renderer.
- check_box_renderer show how to use xtd::forms::check_box_renderer renderer.
- countries shows how to use xtd::forms::countries collection and xtd::forms::country component.
- cursors shows how to used xtd::forms::cursors collection and xtd::forms::cursor component.
- emoticons shows how to used xtd::forms::emoticons collection and xtd::forms::emoticon component.
- directory_entry The DirectoryEntry class encapsulates a node or object in the Active Directory Domain Services hierarchy.
- directory_searcher performs queries against Active Directory Domain Services.
- error_provider provides a user interface for indicating that a control on a form has an error associated with it.
- event_log provides interaction with Windows event logs.
- file_system_watcher listens to the file system change notifications and raises events when a directory, or file in a directory, changes.
- help_provider provides pop-up or online Help for controls.
- image_list provides methods to manage a collection of Image objects. This class cannot be inherited.
- images demonstrates the use of xtd::forms::images class.
- message_queue provides access to a queue on a Message Queuing server.
- performance_counter represents a Windows NT performance counter component.
- process provides access to local and remote processes and enables you to start and stop local system processes.
- radio_button_renderer show how to use xtd::forms::radio_button_renderer renderer.
- screen represents a display device or multiple display devices on a single system.
- serial_port represents a serial port resource.
- service_controller represents a Windows service and allows you to connect to a running or stopped service, manipulate it, or get information about it.
- texts shows how to used xtd::forms::system_texts collection.
- timer implements a timer that raises an event at user-defined intervals. This timer is optimized for use in Windows Forms applications and must be used in a window.
- translator demonstrates the use of xtd::forms::translator strings.
- translator_with_language demonstrates the use of xtd::forms::translator strings.
- use_wait_cursor shows how to use xtd::forms::use_wait_cursor component.
Datas
- binding_navigator represents the navigation and manipulation user interface (UI) for controls on a form that are bound to data.
- binding_source encapsulates the data source for a form.
- chart
- data_grid_view displays data in a customizable grid.
- data_set
Printing
- page_setup_dialog enables users to change page-related print settings, including margins and paper orientation. This class cannot be inherited.
- print_dialog lets users select a printer and choose which sections of the document to print from a Windows Forms application.
- print_document defines a reusable object that sends output to a printer, when printing from a Windows Forms application.
- print_preview_control represents the raw preview part of print previewing from a Windows Forms application, without any dialog boxes or buttons. Most PrintPreviewControl objects are found on PrintPreviewDialog objects, but they do not have to be.
- print_preview_dialog represents a dialog box form that contains a PrintPreviewControl for printing from a Windows Forms application.
Themes
- application_enable_dark_mode shows how to enable dark mode with xtd::forms::application class.
- application_enable_light_mode shows how to enable light mode with xtd::forms::application class.
- themes shows how to use xtd::forms::theme class.
Events
- application_add_message_filter shows how to create an application with xtd::forms::application::add_message_filter method.
- application_application_exit shows how to use xtd::forms::application::application_exit event.
- application_events demonstrates the use of xtd::forms::application events.
- application_idle demonstrates the use of xtd::forms::application::idle event.
- enable_changed_event demonstrates the use of enable_changed event.
- font_changed_event demonstrates the use of font_changed event.
- form_click demonstrates the use of xtd::forms::form event.
- form_custom_event demonstrates how to create custom event with form.
- form_and_messages demonstrates some events received by xtd::forms::form.
- form_paint demonstrates paint event with xtd::forms::form.
- key_events demonstrates the use of key events.
- mouse_events demonstrates the use of mouse events.
- move_form demonstrates the use of move form events.
- send_message_to_form demonstrates how to send message to form.
- wnd_proc demonstrates the use of wnd_proc method.
User Forms
- ball demonstrates the use of xtd::control::region property for create a circular form.
User Dialogs
- user_dialog demonstrates the use of xtd::forms::form as dialog.
- user_dialog_show_sheet demonstrates the use of xtd::forms::form as dialog.
- about_dialog_with_user_pages demonstrates how to add custom tab page to xtd::forms::about_dialog dialog.
User Controls
- button_with_style_sheet demonstrates the xtd::forms::button control with style_sheet.
- graph_control demonstrates the use of xtd::forms::user_control control to crerate own graph.
- line demonstrates the use of xtd::forms::user_controlcontrol to draw simple lines.
- numeric_text_box demonstrates the customize xtd::forms::text_box control.
- owner_button demonstrates the customize xtd::forms::button control.
- toggle_light demonstrates the use of xtd::forms::user_control control to draw toggle light.
Drawing
- draw_ellipse shows how to draw ellipse in paint event.
- draw_image shows how to draw image in paint event.
- draw_line shows how to draw line in paint event.
- draw_point shows how to draw point in paint event.
- draw_rectangle shows how to draw rectangle in paint event.
- draw_rounded_rectangle shows how to draw rounded rectangle in paint event.
- fill_ellipse shows how to fill ellipse in paint event.
- fill_rectangle shows how to fill rectangle in paint event.
- fill_rounded_rectangle shows how to fill rounded rectangle in paint event.
- image_effects shows how to use xtd::drawing::graphics::imaging::image_effector class.
- screenshot shows how to fill ellipse in paint event using xtd::drawing::graphics::copy_from_screen.
Games
- game_of_life The Game of Life is not your typical computer game. It is a 'cellular automaton', and was invented by Cambridge mathematician John Conway.
- minesweeper The goal of the game is to uncover all the squares that do not contain mines.
- tetris The Tetris game is one of the most popular computer games ever created.
Others
-
about_dialog_system represents a dialog box that displays about box.
-
anchors demonstrates the use of xtd::forms::button container with xtd::forms::control::anchor.
-
application_settings2 represents settings application.
-
auto_scroll demonstrates the use of xtd::forms::panel.
-
bitmap_button_with_text demonstrates the use of xtd::forms::button control with xtd::drawing::image.
-
border_style demonstrates the use of xtd::forms::label::border_style property.
-
button2 demonstrates the use of xtd::forms::button control.
-
button3 demonstrates the use of xtd::forms::button control.
-
button4 demonstrates the use of xtd::forms::button control.
-
calculator demonstrates the use of xtd::forms::button control.
-
change_color demonstrated the use of xtd::forms::control back_color and fore_color properties.
-
change_parent demonstrates the use of xtd::forms::control parent property.
-
clock demonstrates the use of xtd::forms::lcd_label control.
-
colored_forms demonstrates the use of xtd::forms::form control and xtd::drawing::color class.
-
colored_tab_pages demonstrates the use of xtd::forms::tab_control and colored xtd::forms::tab_page controls.
-
colors demonstrates the use of xtd::forms::user_control control with xtd::drawing::color.
-
control_with_name_operator shows how to use xtd::forms::control::name property and xtd::forms::layout::arranged_element_collection::operator[] name operator.
-
docked_panels demonstrates the use of xtd::forms::panel.
-
emplace demonstrates the use of xtd::forms::control::control_collection::emplace, xtd::forms::control::control_collection::emplace_at, xtd::forms::control::control_collection::emplace_back methods.
-
flat_button demonstrates the use of xtd::forms::button control with flat style.
-
font_families demonstrates the use of xtd::drawing::font_family class.
-
form_and_main demonstrates how to use startup_ keyword.
-
form_and_thread demonstrates how a thread can update ui with xtd::forms::control::invoke method.
-
form_background_image demonstrates how to use xtd::forms::form class with image_background property.
-
form_background_image2 demonstrates how to use xtd::forms::form class with image_background property.
-
form_decoration demonstrates the use of xtd::forms::form.
-
form_resize shows how to set minimum size, set maximum size, move and resize a form.
-
form_show demonstrates how to launch form as normal window, model-less window and modal window.
-
form_show_hide demonstrates the use of xtd::forms::form show, hide and close methods.
-
form_window_state demonstrates the use of xtd::forms::form window state.
-
form2 represents a window or dialog box that makes up an application's user interface.
-
group_box_and_check_box demonstrates the use of xtd::forms::group_box container and xtd::forms::check_box control.
-
group_box_and_radio_button demonstrates the use of xtd::forms::group_box container and xtd::forms::radio_button control.
-
images2 demonstrates the use of xtd::drawing::system_images class.
-
images3 demonstrates the use of xtd::drawing::system_images class.
-
input_dialog_multiline prompts the user to input multiline text.
-
input_dialog_password prompts the user to input password text.
-
labels_and_unicode_text demonstrates the use of xtd::forms::label control and Unicode text.
-
lcd_label_with_dot_matrix represents the use of xtd::forms::lcd_label control.
-
lcd_label_with_fourteen_segment represents the use of xtd::forms::lcd_label control.
-
lcd_label_with_nine_segment represents the use of xtd::forms::lcd_label control.
-
lcd_label_with_seven_segment represents the use of xtd::forms::lcd_label control.
-
lcd_label_with_sixteen_segment represents the use of xtd::forms::lcd_label control.
-
lcd_label2 represents the use of xtd::forms::lcd_label control.
-
lcd_label3 represents the use of xtd::forms::lcd_label control.
-
main_menu_create_standard_items demonstrates the use of xtd::forms::main_menu::create_standard_items method.
-
painting demonstrates the use of xtd::forms::form, xtd::forms::panel, xtd::forms::track_bar and xtd::forms::button controls with mouse_down, mouse_move and paint events..
-
screen_informations shows how to get screen information of xtd::forms::screen control.
-
smileys demonstrates the use of xtd::forms::label control.
-
some_controls demonstrates the use of some controls.
-
some_system_controls demonstrates the use of some system controls.
-
status_bar_without_panels represents a Windows status bar control without panels.
-
stopwatch_form demonstrates the use of stopwatch class, xtd::forms::label and xtd::forms::button controls.
-
system_report shows system_report with xtd::forms::text_box control.
-
system_sound demonstrates the use of xtd::media::system_sound component.
-
text_box_multiline represents a Windows xtd::forms::text_box control.
-
text_box_password represents a Windows xtd::forms::text_box control.
-
text_box_password2 represents a Windows xtd::forms::text_box control.
-
toggle_button2 represents a xtd::forms::toggle_button control.
-
track_bar2 represents a standard Windows xtd::forms::track_bar.
-
wiggly shows how to animate a user control using timer and timer::event. In addition, the example demonstrates how to use graphics::measure_string to determine the size of text on screen.
-
All You can see all examples here.
Build and run any project
Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:
xtdc run -t any_project_name
