A GUI application using Windows Forms (WinForms) in .Net Programming
KINNARIMISHRA2
1 views
11 slides
Oct 30, 2025
Slide 1 of 11
1
2
3
4
5
6
7
8
9
10
11
About This Presentation
A GUI application using Windows Forms (WinForms) provides a graphical interface for user interaction in .NET. It allows developers to create windows, buttons, text boxes, and menus easily. WinForms simplifies event-driven programming, enabling rapid development of interactive desktop applications wi...
A GUI application using Windows Forms (WinForms) provides a graphical interface for user interaction in .NET. It allows developers to create windows, buttons, text boxes, and menus easily. WinForms simplifies event-driven programming, enabling rapid development of interactive desktop applications with database connectivity, data validation, and rich user experiences.
Size: 554.57 KB
Language: en
Added: Oct 30, 2025
Slides: 11 pages
Slide Content
Unit-3 GUI Application using Winforms Common Controls
Introduction to C# MessageBox Syntax : Message Box is a class in the “ Systems.Windows.Forms ” Namespace and the assembly it is available is “ System.Windows.Forms.dll”.The show method available in the class is used to display the message along with action buttons. The action buttons can be anything ranging from Yes to No, Ok to Cancel.
Example: The following code will create a simple Message Box only with the OK button. string msg = "Test"; MessageBox.Show ( msg );
Types of MessageBox Buttons The following are the types of Buttons that are available in the MessageBox.Show () method. They are OK: It is defined as MessageBoxButtons.OK OK and Cancel: It is defined as MessageBoxButtons.OkCancel . Abort Retry and Ignore: It is defined as MessageBoxButtons.AbortRetryIgnore . Yes No and Cancel: It is defined as MessageBoxButtons.YesNoCancel . Yes and No: It is defined as MessageBoxButtons.YesNo . Retry and Cancel: It is defined as MessageBoxButtons.RetryCancel .
Types of MessageBox Icons The following are the types of MessageBox icons method are: None: No icons are displayed in the Message box. Hand: A hand icon is displayed. It is defined as MessageBoxIcon.Hand . Question: A question mark is displayed. It is defined as MessageBoxIcon.Question . Exclamation: An exclamation mark is displayed. It is defined as MessageBoxIcon.Exclamation . Asterisk: An asterisk symbol is displayed. It is defined as MessageBoxIcon.Asterisk . Stop: A stop icon is displayed. It is defined as MessageBoxIcon.Stop . Error: An error icon is displayed. It is defined as MessageBoxIcon.Error . Warning: A warning icon is displayed. It is defined as MessageBoxIcon.Warning . Information: An info symbol is displayed. It is defined as MessageBoxIcon.Information .
Types of MessageBox Options ServiceNotification : It is defined as MessageBoxOptions.ServiceNotification . This is used to display the message box on the current desktop which is active. The message box is displayed even when no user is logged on to the desktop. DefaultDesktopOnly : It is defined as MessageBoxOptions.DefaultDesktopOnly . This also displays on the currently active desktop. The difference between this and service notification is that here the message is displayed on the interactive window. RightAlign : It is defined as MessageBoxOptions.RightAlign . This is used to format the message in right alignment. RtlReading : It is defined as MessageBoxOptions.RtlReading . This denotes that message is displayed from right to left order.
Input Box Example
Input Box Example
Input Box Example
Input Box Example: using Microsoft.VisualBasic ; private void Form1_Load(object sender, EventArgs e) { int a, b, c; a = int.Parse ( Interaction.InputBox ("Input First value", "Enter first value", "Enter Interger Value", -1, -1)); b = int.Parse ( Interaction.InputBox ("Input Second value", "Enter second value", "Enter Interger Value", -1, -1)); c = a + b; MessageBox.Show ( c.ToString (),"Addition of 2 values",MessageBoxButtons.OKCancel,MessageBoxIcon.Information ); }