Winforms code snippets (77)

How to get custom data from clipboard

Published: 26. September 2014 | Updated: 26. September 2014
Categories: Windows
Tags: C# Windows Winforms WPF

How to get file drop list from clipboard

Published: 26. September 2014 | Updated: 26. September 2014
Categories: Windows
Tags: C# File System Windows Winforms WPF

How to get audio stream from clipboard

Published: 26. September 2014 | Updated: 26. September 2014
Categories: Windows
Tags: C# Media Windows Winforms WPF

How to get (formatted) text from clipboard

Published: 26. September 2014 | Updated: 26. September 2014
Categories: Windows
Tags: C# Text Windows Winforms WPF

How to get image from clipboard

Published: 8. January 2009 | Updated: 26. September 2014
Categories: Windows
Tags: C# GDI Windows Winforms WPF

How to prevent opening multiple instance of application

Published: 11. January 2014 | Updated: 11. January 2014
Categories: Winforms WPF
Tags: C# Security Threading Windows Winforms WPF

How to open message box

Published: 1. February 2012 | Updated: 1. February 2012
Categories: Winforms WPF
Tags: C# UI Windows Winforms WPF

How to get battery information

Published: 20. November 2011 | Updated: 20. November 2011
Categories: Hardware
Tags: C# Hardware Windows Winforms

How to find out whether Windows UI effects are enabled

Published: 19. November 2011 | Updated: 19. November 2011
Categories: Windows
Tags: C# UI Windows Winforms WPF

How to find out whether program is running in a remote session

Published: 19. November 2011 | Updated: 19. November 2011
Categories: Win32 Windows
Tags: C# Win32 Windows Winforms WPF

How to change cursor

Published: 14. December 2008 | Updated: 10. November 2011
Categories: Winforms
Tags: C# UI Windows Winforms

How to get distance between two points

Published: 13. December 2008 | Updated: 5. November 2011
Categories: GDI Math
Tags: C# GDI Math Winforms WPF

How to find out whether form is active

Published: 27. October 2011 | Updated: 27. October 2011
Categories: Winforms
Tags: C# UI Winforms

How to hide windows form

Published: 27. October 2011 | Updated: 27. October 2011
Categories: Winforms
Tags: C# UI Winforms

How to get information about all monitors

Published: 27. October 2011 | Updated: 27. October 2011
Categories: Hardware
Tags: C# Hardware Windows Winforms

How to get monitors count

Published: 27. October 2011 | Updated: 27. October 2011
Categories: Hardware
Tags: C# Hardware Windows Winforms

How to list all open forms in Winforms

Published: 27. October 2011 | Updated: 27. October 2011
Categories: Winforms
Tags: C# UI Winforms

How to launch custom process

Published: 13. December 2008 | Updated: 27. October 2011
Categories: Processes
Tags: C# Windows Winforms

How to close a form in Winforms

Published: 27. October 2011 | Updated: 27. October 2011
Categories: Winforms
Tags: C# UI Winforms

How to minimize form in Winforms

Published: 27. October 2011 | Updated: 27. October 2011
Categories: Winforms
Tags: C# UI Winforms

How to get handle of a window

Published: 27. October 2011 | Updated: 27. October 2011
Categories: Winforms
Tags: C# Winforms

How to load xml to DataSet

Published: 15. January 2009 | Updated: 26. October 2011
Categories: XML
Tags: C# Webforms Winforms XML

How to manually create and fill DataTable

Published: 14. December 2008 | Updated: 26. October 2011
Categories: Databases Winforms
Tags: C# SQL Webforms Winforms WPF

How to read a windows registry key

Published: 13. December 2008 | Updated: 26. October 2011
Categories: Registry
Tags: C# Windows Winforms

How to get current Windows user

Published: 13. December 2008 | Updated: 26. October 2011
Categories: Authorization
Tags: C# Security Windows Winforms

How to get screen size

Published: 12. January 2009 | Updated: 26. October 2011
Categories: GDI Hardware
Tags: C# GDI Hardware Windows Winforms

How to open url address in browser

Published: 13. December 2008 | Updated: 26. October 2011
Categories: Network Processes
Tags: C# Network Windows Winforms

How to get current process

Published: 13. December 2008 | Updated: 26. October 2011
Categories: Processes
Tags: C# Windows Winforms

How to convert Color to hex code

Published: 21. October 2011 | Updated: 26. October 2011
Categories: Colors
Tags: C# Colors Conversion Winforms WPF

How to get color from hex code

Published: 21. October 2011 | Updated: 26. October 2011
Categories: Colors
Tags: C# Colors Conversion Winforms WPF

How to get color from ARGB

Published: 24. October 2011 | Updated: 26. October 2011
Categories: Colors
Tags: C# Colors Conversion Winforms WPF

How to get color from name

Published: 24. October 2011 | Updated: 26. October 2011
Categories: Colors
Tags: C# Colors Conversion Winforms WPF

How to get system colors

Published: 24. October 2011 | Updated: 24. October 2011
Categories: Windows
Tags: C# Colors Windows Winforms WPF

How to get predefined colors

Published: 24. October 2011 | Updated: 24. October 2011
Categories: Framework
Tags: C# Colors Winforms WPF

How to get color input from user using ColorDialog

Published: 14. December 2008 | Updated: 21. October 2011
Categories: GDI Winforms
Tags: C# Colors Winforms

How to disable mouse in Winforms

Published: 14. October 2011 | Updated: 14. October 2011
Categories: Winforms
Tags: C# Winforms

How to hide form from taskbar and Alt+TAB

Published: 22. January 2009 | Updated: 12. October 2011
Categories: Winforms
Tags: C# Windows Winforms

How to get value from AppSettings in App.config or Web.config

Published: 9. October 2011 | Updated: 9. October 2011
Categories: Framework
Tags: C# Console Winforms WPF

How to get connection string from App.config or Web.config

Published: 9. October 2011 | Updated: 9. October 2011
Categories: Databases Framework
Tags: C# SQL Winforms WPF

How to get name of application

Published: 9. October 2011 | Updated: 9. October 2011
Categories: Reflection
Tags: C# Console Reflection Winforms WPF

How to get build number

Published: 9. October 2011 | Updated: 9. October 2011
Categories: Reflection
Tags: C# Console Reflection Winforms WPF

How to get working directory / location

Published: 9. October 2011 | Updated: 9. October 2011
Categories: Consoles Directories Winforms
Tags: C# Console Winforms WPF

How to exit application

Published: 9. October 2011 | Updated: 9. October 2011
Categories: Consoles Winforms
Tags: C# Console Winforms

How to get command line for process

Published: 9. October 2011 | Updated: 9. October 2011
Categories: Framework
Tags: C# Console Winforms

How to get focused control

Published: 27. January 2009 | Updated: 9. October 2011
Categories: Win32 Winforms
Tags: C# Controls Win32 Winforms

How to detect save mode in Windows

Published: 26. January 2009 | Updated: 26. September 2011
Categories: Windows
Tags: C# Windows Winforms

How to convert handle to form

Published: 15. January 2009 | Updated: 26. September 2011
Categories: Unsafe Code Winforms
Tags: C# Controls Windows Winforms

How to render high quality antialiased text

Published: 27. January 2009 | Updated: 26. September 2011
Categories: GDI
Tags: C# GDI Text Winforms

How to show/hide mouse cursor

Published: 22. January 2009 | Updated: 22. January 2009
Categories: Winforms
Tags: C# Windows Winforms

How to send email using default mail client

Published: 22. January 2009 | Updated: 22. January 2009
Categories: Network
Tags: C# Network Windows Winforms

How to choose font using FontDialog

Published: 21. January 2009 | Updated: 21. January 2009
Categories: Winforms
Tags: C# Winforms

How to show help file

Published: 21. January 2009 | Updated: 21. January 2009
Categories: Winforms
Tags: C# Controls Winforms

How to show online help

Published: 21. January 2009 | Updated: 21. January 2009
Categories: Winforms
Tags: C# Controls Winforms

How to show help pop-up window

Published: 21. January 2009 | Updated: 21. January 2009
Categories: Winforms
Tags: C# Controls Winforms

How to save / load RTF document using RichTextBox

Published: 21. January 2009 | Updated: 21. January 2009
Categories: Winforms
Tags: C# Text Winforms

How to keep a form always on top

Published: 21. January 2009 | Updated: 21. January 2009
Categories: Winforms
Tags: C# Winforms

How to get active MDI child

Published: 21. January 2009 | Updated: 21. January 2009
Categories: Winforms
Tags: C# Winforms

How to draw image from file

Published: 21. January 2009 | Updated: 21. January 2009
Categories: GDI
Tags: C# GDI Winforms

How to choose folder using FolderBrowserDialog

Published: 21. January 2009 | Updated: 21. January 2009
Categories: Directories Winforms
Tags: C# Windows Winforms

How to draw centered text

Published: 21. January 2009 | Updated: 21. January 2009
Categories: GDI
Tags: C# GDI Text Winforms

How to get image encoder/decoder by image format

Published: 20. January 2009 | Updated: 20. January 2009
Categories: GDI
Tags: C# GDI Winforms

How to get installed image decoders

Published: 20. January 2009 | Updated: 20. January 2009
Categories: GDI
Tags: C# GDI Winforms

How to get installed image encoders

Published: 20. January 2009 | Updated: 20. January 2009
Categories: GDI
Tags: C# GDI Winforms

How to render buffered graphics

Published: 20. January 2009 | Updated: 20. January 2009
Categories: GDI
Tags: C# Controls GDI Winforms

How to send keys to application

Published: 8. January 2009 | Updated: 8. January 2009
Categories: Winforms
Tags: C# Windows Winforms

How to stop playing background sound

Published: 8. January 2009 | Updated: 8. January 2009
Categories: Winforms
Tags: C# Media Windows Winforms

How to play sound in C#

Published: 8. January 2009 | Updated: 8. January 2009
Categories: Winforms
Tags: C# Media Windows Winforms

How to get currently active form for application

Published: 8. January 2009 | Updated: 8. January 2009
Categories: Winforms
Tags: C# Controls UI Winforms

How to flash form taskbar button

Published: 21. December 2008 | Updated: 21. December 2008
Categories: Win32 Winforms
Tags: C# UI Win32 Windows Winforms

How to use console output in winforms

Published: 15. December 2008 | Updated: 20. December 2008
Categories: Win32 Winforms
Tags: C# Console Win32 Windows Winforms

How to access control from different thread

Published: 15. December 2008 | Updated: 20. December 2008
Categories: Threading Winforms
Tags: C# Controls Threading Winforms

How to create MDI form

Published: 18. December 2008 | Updated: 18. December 2008
Categories: Winforms
Tags: C# Controls UI Winforms

How to set tooltip for control

Published: 18. December 2008 | Updated: 18. December 2008
Categories: Winforms
Tags: C# Controls UI Winforms

How to create control and add to form on the fly

Published: 15. December 2008 | Updated: 15. December 2008
Categories: Winforms
Tags: C# Controls UI Winforms

How to disable close 'x' button in winform

Published: 15. December 2008 | Updated: 15. December 2008
Categories: Win32 Winforms
Tags: C# UI Windows Winforms

How to create file open dialog

Published: 14. December 2008 | Updated: 14. December 2008
Categories: Winforms
Tags: C# File System UI Winforms

How to create file save dialog

Published: 14. December 2008 | Updated: 14. December 2008
Categories: Winforms
Tags: C# File System UI Winforms