-
Notifications
You must be signed in to change notification settings - Fork 1
API ModernFormsNext Application
This class is responsible for starting the UI message loop, tracking open forms, dispatching actions to the UI thread, and shutting down the application.
Before the main loop starts, the framework backend is initialized automatically
through `ModernFormsNext.WindowKit.Backend.FrameworkBootstrap`.
`csharp
var form = new MainForm();
Application.Run(form);
`
This event is raised when ModernFormsNext.Application.Exit is called or when the main application
loop finishes without the application already being marked as exiting.
-
closeMenus-trueto deactivate the active menu; otherwise,false. -
closePopups-trueto hide the active popup window; otherwise,false.
This method iterates through ModernFormsNext.Application.OpenForms and calls each form's theme
change handler.
This method marks the application as exiting, raises the ModernFormsNext.Application.OnExit event,
and cancels the main loop cancellation token if the application loop is running.
Calling this method does not forcefully terminate the process. It requests a graceful
shutdown of the UI loop.
-
mainForm- The main form to show before entering the UI loop.
This method ensures that the backend is initialized, shows the specified form, and then starts the UI message loop.
When the provided form is closed, the application exits automatically.
`csharp
var mainForm = new MainForm();
Application.Run(mainForm);
`
-
closable- An object that controls application lifetime and exposes aClosedevent.
This overload starts the UI message loop without requiring a ModernFormsNext.Form instance.
It is useful for advanced hosting scenarios where a custom closeable root object controls
the lifetime of the application.
This method can only be called once during the lifetime of the process.
-
action- The action to execute on the UI thread.
`csharp
Application.RunOnUIThread(() =>
{
myForm.Text = "Updated from another thread";
});
`
The value is initialized lazily from System.AppContext.BaseDirectory.
- Home
-
API Reference
- AccessibleEvents
- AccessibleNavigation
- AccessibleObject
- AccessibleObjectNotificationEventArgs
- AccessibleRole
- AccessibleSelection
- AccessibleStates
- PlatformAccessibleObjectAdapter
- QueryAccessibilityHelpEventArgs
- QueryAccessibilityHelpEventHandler
- AnchorStyles
- Animation
- AnimationManager
- ControlAnimationEffects
- ControlAnimationExtensions
- Easings
- Application
- ArrowDirection
- AutoSizeMode
- BorderSideStyle
- BorderStyle
- BoundsSpecified
- BuiltInTheme
- Button
- CheckBox
- CheckState
- Clipboard
- ColorBox
- ColorDialog
- ColumnStyle
- ComboBox
- CommonDialog
- ContentAlignment
- ContextMenu
- Control
- ControlAccessibleObject
- ControlCollection
- ControlBehaviors
- ControlPaint
- ControlStyle
- Cursor
- Cursors
- BaseCollection
- BindableComponent
- Binding
- BindingCompleteContext
- BindingCompleteEventArgs
- BindingCompleteEventHandler
- BindingCompleteState
- BindingContext
- BindingManagerBase
- BindingManagerDataErrorEventArgs
- BindingManagerDataErrorEventHandler
- BindingMemberInfo
- BindingsCollection
- BindingSource
- BindingValueFormatter
- ControlBindingsCollection
- ControlUpdateMode
- ConvertEventArgs
- ConvertEventHandler
- CurrencyManager
- DataSourceUpdateMode
- IBindableComponent
- ICommandExecutor
- ICurrencyManagerProvider
- ItemChangedEventArgs
- ItemChangedEventHandler
- ListBindingConverter
- ListBindingHelper
- ListManagerBindingsCollection
- PropertyManager
- RelatedCurrencyManager
- DataGridView
- DataGridViewCell
- DataGridViewCellCollection
- DataGridViewCellEditEventArgs
- DataGridViewColumn
- DataGridViewColumnCollection
- DataGridViewColumnHeaderCell
- DataGridViewHeaderCell
- DataGridViewRow
- DataGridViewRowCollection
- DataGridViewRowHeaderCell
- DataGridViewSelectionMode
- DateTimePicker
- DateTimePickerCalendar
- DateTimePickerFormat
- DialogResult
- DockStyle
- Brush
- GlassBrush
- GradientBrush
- GradientStop
- LinearGradientBrush
- RadialGradientBrush
- SolidColorBrush
- SweepGradientBrush
- DrawingExtensions
- EventArgs`1
- FileDialog
- FileSystemDialog
- FlowDirection
- FlowLayoutPanel
- FlowLayoutSettings
- FolderBrowserDialog
- Font
- FontDialog
- FontDialogRenderingMode
- FontStyle
- Form
- FormCollection
- FormStartPosition
- FormTitleBar
- TitleBarButtonGlyph
- FormWindowState
- Help
- HelpEventArgs
- HelpEventHandler
- HelpNavigator
- HelpProvider
- HorizontalAlignment
- HorizontalScrollBar
- HueSlider
- IContainerControl
- ILayoutable
- ImageCollection
- ImageList
- InsertKeyMode
- KeyEventArgs
- KeyPressEventArgs
- Keys
- Label
- ContainerProxy
- ElementProxy
- TopDownProxy
- VerticalElementProxy
- LayoutEngine
- PropertyStore
- IntegerEntry
- ObjectEntry
- ContainerInfo
- LayoutInfo
- LayoutEventArgs
- LayoutSettings
- LinkArea
- LinkBehavior
- LinkLabel
- Link
- LinkCollection
- LinkLabelLinkClickedEventArgs
- LinkState
- ListBox
- ListBoxItemCollection
- ListView
- ListViewItem
- ListViewItemCollection
- MaskedTextBox
- MaskFormat
- MaskInputRejectedEventArgs
- MaskInputRejectedEventHandler
- Menu
- MenuBase
- MenuDropDown
- MenuItem
- MenuItemCollection
- MenuSeparatorItem
- MessageBoxForm
- MouseButtons
- MouseEventArgs
- NavigationPane
- NavigationPaneItem
- NavigationPaneItemCollection
- NotifyIcon
- NotifyIconActivationBehavior
- NotifyIconBalloonIcon
- NotifyIconContextMenu
- NotifyIconMenuItem
- NotifyIconMenuItemCollection
- NotifyIconMenuSeparatorItem
- NumericUpDown
- NumericUpDownTextBox
- OpenFileDialog
- Orientation
- Padding
- PaintEventArgs
- Panel
- PictureBox
- PictureBoxSizeMode
- PopupWindow
- ProgressBar
- RadioButton
- ButtonRenderer
- CheckBoxRenderer
- ColorBoxRenderer
- ComboBoxRenderer
- DataGridViewRenderer
- DateTimePickerRenderer
- FormTitleBarRenderer
- HueSliderRenderer
- IRenderGlyph
- IRenderTextAndImage
- LabelRenderer
- LinkLabelRenderer
- ListBoxRenderer
- ListViewRenderer
- MenuDropDownRenderer
- MenuRenderer
- NavigationPaneRenderer
- NumericUpDownRenderer
- PanelRenderer
- PictureBoxRenderer
- ProgressBarRenderer
- RadioButtonRenderer
- Renderer
- Renderer`1
- RenderManager
- RibbonRenderer
- ScrollableControlRenderer
- ScrollBarRenderer
- SplitContainerRenderer
- SplitterRenderer
- StatusBarRenderer
- TabControlRenderer
- TabStripRenderer
- TextBoxRenderer
- ToolBarRenderer
- TrackBarRenderer
- TreeViewRenderer
- Ribbon
- RibbonItemGroup
- RibbonItemGroupCollection
- RibbonTabPage
- RibbonTabPageCollection
- RowStyle
- SaveFileDialog
- ScrollableControl
- ScrollBar
- ScrollBars
- ScrollControl
- ScrollEventArgs
- ScrollEventType
- ScrollOrientation
- ScrollProperties
- SelectionMode
- SizeType
- SkiaExtensions
- SkiaTextExtensions
- SortOrder
- SplitContainer
- Splitter
- StatusBar
- TabControl
- TableLayoutCellPaintEventArgs
- TableLayoutColumnStyleCollection
- TableLayoutControlCollection
- TableLayoutPanel
- TableLayoutPanelCellBorderStyle
- TableLayoutPanelCellPosition
- TableLayoutPanelGrowStyle
- TableLayoutRowStyleCollection
- TableLayoutSettings
- TableLayoutStyle
- TableLayoutStyleCollection
- TabPage
- TabPageCancelEventArgs
- TabPageCollection
- TabPageEventArgs
- TabStrip
- TabStripItem
- TabDisplayMode
- TabStripItemCollection
- TabStripItemEventArgs
- TextBox
- TextImageRelation
- TextMeasurer
- TextSelection
- Theme
- TickStyle
- Timer
- ToolBar
- TrackBar
- TreeView
- TreeViewControlStyle
- TreeViewDrawEventArgs
- TreeViewDrawMode
- TreeViewItem
- TreeViewItemElement
- TreeViewItemCollection
- TypeValidationEventArgs
- TypeValidationEventHandler
- VerticalScrollBar
- WindowBase