Visual Programming
.NET
Farman Ullah
5
❑C# vs .Net
4
3
2
1
❑CLR (Common Language Run-time)
❑Architecture of .Net Applications
Visual Programming
❑Native AOT (Ahead-of-Time) in .NET
❑Our First C# Application
Visual programming is a programming
paradigm where users create programs by
manipulating graphical elements rather than
writing code. It uses visual representations
like icons, blocks, or diagrams to represent
logic and functions.
Visual Programming
❖ Easier with simple programs
❖ Less likely to make mistakes
❖ Visual Basic, Visual C#, Visual C++
❖ visual tool for creating graphical user interface (GUI),
but lots of text based programming still required
Console Application (Programming)
vs
GUI Programming
vs
Visual Programming
Console Application (Programming)
Applications that interact with users through a text-based
command-line interface (CLI).
❑ Input and output are text-based (e.g., typing
commands and reading text responses).
❑ Lightweight and efficient, with minimal resource
usage.
❑ Often used for system utilities, scripting, and
backend services.
GUI Programming
GUI programming involves writing code to create and
manage graphical interfaces (buttons, windows, menus,
etc.) for applications.
❖ Requires coding in languages like Python (Tkinter,
PyQt), Java (Swing, JavaFX)
❖ Uses manual coding to define UI elements and their
behaviors.
❖ Offers more flexibility and customization.
import tkinter as tk
root = tk.Tk()
root.title("GUI Example")
button = tk.Button(root, text="Click Me",
command=lambda: print("Button Clicked"))
button.pack()
root.mainloop()
👉 Here, you manually write code to create and
control the UI.
import javax.swing.*;
public class GuiExample {
public static void main(String[] args) {
// Create the main frame (window)
JFrame frame = new JFrame("GUI Example");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300, 200);
// Create a button with a click event
JButton button = new JButton("Click Me");
button.addActionListener(e -> System.out.println("Button
Clicked"));
// Add button to frame
frame.getContentPane().add(button);
// Make the frame visible
frame.setVisible(true);
}
}
Visual Programming
Visual programming allows developers to design
applications using drag-and-drop graphical elements
instead of writing code manually.
❑ Uses pre-built components like buttons, forms, and
menus that can be arranged visually.
❑ Requires little to no coding (low-code/no-code
approach).
👉 In Visual Basic, you can drag a button
onto a form and set its properties (color,
size, text) without writing code.
C#
C# vs .NET
.Net
❖ A modern, object-oriented programming language
developed by Microsoft.
❖ Primarily used for building Windows applications, web
services, and mobile apps.
❖ Part of the .NET ecosystem but can be used
independently in other environments.
❖A cross-platform, open-source development framework
for building and running applications.
❖Supports multiple languages (C#, F#, VB.NET) and
provides libraries, runtime, and tools.
❖Includes .NET Runtime (executes code) and .NET SDK
(tools for development).
.NET Versions Overview
.NET Framework (2002-2022):
Original Windows-only framework for building desktop and
web apps.
Latest version: .NET Framework 4.8.
.NET Core (2016-2020):
Cross-platform, open-source successor to .NET Framework.
Focused on modern, high-performance apps.
Latest version: .NET Core 3.1.
.NET 5+ (2020-Present):
Unified platform combining .NET Framework, .NET Core, and
Xamarin.
Cross-platform, open-source, and supports all app types.
Latest version: .NET 9 (as of 2025).
.Net the History
2
1
3
.Net Framework .Net Core .Net (C# 13)
2020
2016
2002
.Net Framework 1.0
(2002)
.Net Framework 4.8
(2019)
To
.Net Core 1.0
(2016)
.Net Core 3.1
(2019)
To
.Net 5
(2020)
.Net 9
(2024)
To
platform was rebranded as .NET. Starting with .NET 5, Microsoft unified .NET
Core, .NET Framework, and Xamarin into a single platform called .NET.
.NET Framework 4.8.1.
2022 (windows 11 update)
.NET Framework
Windows Forms
ASP.NET
Web Services
ASP.NET Application Services
Web Forms Controls Drawing
Windows Application Services
Framework Class Library
ADO.NET
Network
XML
Security
Threading
Diagnostics
IO
Etc.
Common Language Runtime
Memory Management Common Type System Lifecycle Monitoring
❖ The .NET Framework is a framework for
developing and implementing software for
personal computer, web etc.
❖ It was designed and is maintained by Microsoft
Corporation.
❖ It came out around the year 2000, even though
Microsoft started its development in early 90s.
❖ .NET has a rich collection of class library (called
the Base Class Library) to implement GUI, query,
database, web services etc.
CLR (Common Language Run-time)
❖ Programs developed with .NET needs a virtual
machine to run on a host. This virtual machine is
called Common Language Runtime (CLR).
❖ Since the compiler doesn’t produce native machine
code, and its product is interpreted by the CLR,
there’s much security.
❖ .NET allows using types defined by one .NET
language to be used by another under the
Common Language Infrastructure (CLI)
specification, for the conforming languages.
Native AOT (Ahead-of-Time) in .NET
o A compilation model that pre-compiles .NET
applications into native machine code at build time.
o Eliminates the need for a JIT (Just-In-Time) compiler
at runtime.
Benefits:
o Faster startup times.
o Reduced memory usage.
o Smaller deployment sizes.
Use Cases:
o Ideal for performance-critical and resource-constrained
environments.
Availability:
o Supported in .NET 7 and later.
o Primarily for console apps and libraries.
visual programming .NET Framework  Lacture 1.pdf

visual programming .NET Framework Lacture 1.pdf

  • 1.
  • 2.
    5 ❑C# vs .Net 4 3 2 1 ❑CLR(Common Language Run-time) ❑Architecture of .Net Applications Visual Programming ❑Native AOT (Ahead-of-Time) in .NET ❑Our First C# Application
  • 3.
    Visual programming isa programming paradigm where users create programs by manipulating graphical elements rather than writing code. It uses visual representations like icons, blocks, or diagrams to represent logic and functions. Visual Programming ❖ Easier with simple programs ❖ Less likely to make mistakes ❖ Visual Basic, Visual C#, Visual C++ ❖ visual tool for creating graphical user interface (GUI), but lots of text based programming still required
  • 4.
    Console Application (Programming) vs GUIProgramming vs Visual Programming
  • 5.
    Console Application (Programming) Applicationsthat interact with users through a text-based command-line interface (CLI). ❑ Input and output are text-based (e.g., typing commands and reading text responses). ❑ Lightweight and efficient, with minimal resource usage. ❑ Often used for system utilities, scripting, and backend services.
  • 6.
    GUI Programming GUI programminginvolves writing code to create and manage graphical interfaces (buttons, windows, menus, etc.) for applications. ❖ Requires coding in languages like Python (Tkinter, PyQt), Java (Swing, JavaFX) ❖ Uses manual coding to define UI elements and their behaviors. ❖ Offers more flexibility and customization.
  • 7.
    import tkinter astk root = tk.Tk() root.title("GUI Example") button = tk.Button(root, text="Click Me", command=lambda: print("Button Clicked")) button.pack() root.mainloop() 👉 Here, you manually write code to create and control the UI.
  • 8.
    import javax.swing.*; public classGuiExample { public static void main(String[] args) { // Create the main frame (window) JFrame frame = new JFrame("GUI Example"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(300, 200); // Create a button with a click event JButton button = new JButton("Click Me"); button.addActionListener(e -> System.out.println("Button Clicked")); // Add button to frame frame.getContentPane().add(button); // Make the frame visible frame.setVisible(true); } }
  • 9.
    Visual Programming Visual programmingallows developers to design applications using drag-and-drop graphical elements instead of writing code manually. ❑ Uses pre-built components like buttons, forms, and menus that can be arranged visually. ❑ Requires little to no coding (low-code/no-code approach). 👉 In Visual Basic, you can drag a button onto a form and set its properties (color, size, text) without writing code.
  • 11.
    C# C# vs .NET .Net ❖A modern, object-oriented programming language developed by Microsoft. ❖ Primarily used for building Windows applications, web services, and mobile apps. ❖ Part of the .NET ecosystem but can be used independently in other environments. ❖A cross-platform, open-source development framework for building and running applications. ❖Supports multiple languages (C#, F#, VB.NET) and provides libraries, runtime, and tools. ❖Includes .NET Runtime (executes code) and .NET SDK (tools for development).
  • 12.
    .NET Versions Overview .NETFramework (2002-2022): Original Windows-only framework for building desktop and web apps. Latest version: .NET Framework 4.8. .NET Core (2016-2020): Cross-platform, open-source successor to .NET Framework. Focused on modern, high-performance apps. Latest version: .NET Core 3.1. .NET 5+ (2020-Present): Unified platform combining .NET Framework, .NET Core, and Xamarin. Cross-platform, open-source, and supports all app types. Latest version: .NET 9 (as of 2025).
  • 13.
    .Net the History 2 1 3 .NetFramework .Net Core .Net (C# 13) 2020 2016 2002 .Net Framework 1.0 (2002) .Net Framework 4.8 (2019) To .Net Core 1.0 (2016) .Net Core 3.1 (2019) To .Net 5 (2020) .Net 9 (2024) To platform was rebranded as .NET. Starting with .NET 5, Microsoft unified .NET Core, .NET Framework, and Xamarin into a single platform called .NET. .NET Framework 4.8.1. 2022 (windows 11 update)
  • 14.
    .NET Framework Windows Forms ASP.NET WebServices ASP.NET Application Services Web Forms Controls Drawing Windows Application Services Framework Class Library ADO.NET Network XML Security Threading Diagnostics IO Etc. Common Language Runtime Memory Management Common Type System Lifecycle Monitoring
  • 15.
    ❖ The .NETFramework is a framework for developing and implementing software for personal computer, web etc. ❖ It was designed and is maintained by Microsoft Corporation. ❖ It came out around the year 2000, even though Microsoft started its development in early 90s. ❖ .NET has a rich collection of class library (called the Base Class Library) to implement GUI, query, database, web services etc.
  • 16.
    CLR (Common LanguageRun-time) ❖ Programs developed with .NET needs a virtual machine to run on a host. This virtual machine is called Common Language Runtime (CLR). ❖ Since the compiler doesn’t produce native machine code, and its product is interpreted by the CLR, there’s much security. ❖ .NET allows using types defined by one .NET language to be used by another under the Common Language Infrastructure (CLI) specification, for the conforming languages.
  • 17.
    Native AOT (Ahead-of-Time)in .NET o A compilation model that pre-compiles .NET applications into native machine code at build time. o Eliminates the need for a JIT (Just-In-Time) compiler at runtime. Benefits: o Faster startup times. o Reduced memory usage. o Smaller deployment sizes. Use Cases: o Ideal for performance-critical and resource-constrained environments. Availability: o Supported in .NET 7 and later. o Primarily for console apps and libraries.