SlideShare a Scribd company logo
1 of 41
Topic Name:
TrackBar & TreeView
MUAHAMMAD WASEEM ASIM
ROLL NO. 939
TrackBar
 The TrackBar control is a special slider control that allows the
user to select a numeric value by changing the position of the
slider.
 The TrackBar is controlled mainly by three properties:
Minimum, Maximum and Value.
TrackBar
Properties of TrackBar
 Size: Set the height and width of the control.
 BackColor: Set the back color.
 Visible: Hide / show property.
 Value: The by default value of TrackBar Maximum is 10
and Minimum is 0.
First Property “Size”
First Property “Size”
Second Property “BackColor”
Third Property “Visible”
Fourth Property “Value”
Common Properties
Visually Drag Drop
 This will display the “New Project” dialog as shown below,
where you should follow these steps:
1. Choose “Visual C#” from the list of templates on the left hand
side of the dialog.
2. Choose the “Windows Forms Application” template from the
center list.
3. Enter a name for the project. I’m using “Track.Bar”.
4. Uncheck the “Create directory for solution” box.
Visually Drag Drop
 Clicking on “Toolbox” on the left-hand side of the window, as
shown below, will display the “Toolbox” panel. I find it
convenient when I’m designing a form to click the push-pin at
the upper right of the “Toolbox” panel so that it remains visible
and is easier to access.
 The TrackBar control is not in this list and you’ll need to expand
the “All Windows Forms” and look for “TrackBar”, as shown to
the right.
Object Creation
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
 using System.Drawing;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 namespace TrackBar
 {
Object Creation…Continue
 public partial class Form1 : Form
 {
 public Form1()
 {
 InitializeComponent();
 }
 private void trackBar1_Scroll(object sender, EventArgs e)
 {
 label1.Text = trackBar1.Value.ToString();
 }
 private void label1_Click(object sender, EventArgs e)
 {
 }
Object Creation…Continue
 private void Form1_Load(object sender, EventArgs e)
 {
 label1.Text = "0";
 trackBar1.Maximum = 0;
 trackBar1.Maximum = 200;
 trackBar1.TickFrequency = 5;
 }
 }
 }
Object Creation…Continue.. Show
Object Creation
Object Creation…Continue
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
 using System.Drawing;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 namespace Track_Bar_with_picture_Box
 {
 public partial class Form1 : Form
 {
Object Creation…Continue
 public Form1()
 {
 InitializeComponent();
 }
 private void Form1_Load(object sender, EventArgs e)
 {
 trackBar1.Minimum = 0;
 trackBar1.Maximum = 400;
 pictureBox1.Left = (ClientSize.Width - pictureBox1.Width) / 2;
 pictureBox1.Top = (ClientSize.Height - pictureBox1.Height) / 2;
 }
 private void pictureBox1_Click(object sender, EventArgs e)
 {
 }
Object Creation…Continue
 private void trackBar1_Scroll(object sender, EventArgs e)
 {
 pictureBox1.Size = new Size(trackBar1.Value,
pictureBox1.Size.Height);
 pictureBox1.Left = (ClientSize.Width - pictureBox1.Width) / 2;
 pictureBox1.Top = (ClientSize.Height - pictureBox1.Height) / 2;
 }
 }
 }
Object Creation…Continue.. Show
Events
 Value: The by default value of TrackBar Maximum is 10 and
Minimum is 0.
 Minimum and Maximum: these two properties are used to define
the range that the thumbs can scroll over.
 i.e. trackBar1.Minimum = 0;
 i.e. trackBar1.Maximum = 200;
 LargeTickFrequency: this property is used to set the space
between the large tick marks.
 SmallTickFrequency: this property is used to set the space
between the small tick marks.
 i.e. trackBar1.TickFrequency = 5;
Use
TreeView
TreeView
 The TreeView control contains a hierarchy of TreeViewItem
controls. It provides a way to display information in a
hierarchical structure by using collapsible nodes . The top level
in a tree view are root nodes that can be expanded or collapsed if
the nodes have child nodes.
TreeView
Properties of TreeView
 BackColor: Gets or sets the background color of the tree
node.
 Bounds: Gets the bounds of the tree node.
 Checked: Gets or sets a value indicating whether the tree
node is in a checked state.
 FirstNode: Gets the first child tree node in the tree node
collection.
 ForeColor: Gets or sets the foreground color of the tree
node.
Properties of TreeView
 FullPath: Gets the path from the root tree node to the current
tree node.
 Handle: Gets the handle of the tree node.
 ImageIndex: Gets or sets the image list index value of the
image displayed when the tree node is in the
unselected state.
 ImageKey: Gets or sets the key for the image associated with
this tree node when the node is in an unselected state.
Visually Drag Drop
 This will display the “New Project” dialog as shown below,
where you should follow these steps:
1. Choose “Visual C#” from the list of templates on the left hand
side of the dialog.
2. Choose the “Windows Forms Application” template from the
center list.
3. Enter a name for the project. I’m using “TreeView”.
4. Uncheck the “Create directory for solution” box.
Visually Drag Drop
 Clicking on “TreeView” on the left-hand side of the window, as
shown below, will display the “Toolbox” panel. I find it
convenient when I’m designing a form to click the push-pin at
the upper right of the “Toolbox” panel so that it remains visible
and is easier to access.
 The TrackBar control is not in this list and you’ll need to expand
the “All Windows Forms” and look for “TreeView”, as shown to
the right.
Constructors
 TreeView() Initializes a new instance of the TreeView class.
Object Creation
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
 using System.Drawing;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 namespace TreeView1
 {
Object Creation…Continue
 public partial class Form1 : Form
 {
 public Form1()
 {
 InitializeComponent();
 TreeNode tNode;
 tNode = treeView1.Nodes.Add("Welcome...");
 }
 private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
 {
Object Creation…Continue
 treeView1.Nodes[0].Nodes.Add("Windows");
 treeView1.Nodes[0].Nodes[0].Nodes.Add("Windows 7");
 treeView1.Nodes[0].Nodes[0].Nodes.Add("Windows 8");
 treeView1.Nodes[0].Nodes[0].Nodes[1].Nodes.Add("Windows 8.1");
 treeView1.Nodes[0].Nodes.Add("Operating System");
 treeView1.Nodes[0].Nodes[1].Nodes.Add("Unix");
 treeView1.Nodes[0].Nodes[1].Nodes.Add("Linux");
 treeView1.Nodes[0].Nodes.Add("Database");
 treeView1.Nodes[0].Nodes[2].Nodes.Add("ORACLE");
 treeView1.Nodes[0].Nodes[2].Nodes.Add("SQL SERVER");
Object Creation…Continue
 treeView1.Nodes[0].Nodes.Add(".net language");
 treeView1.Nodes[0].Nodes[3].Nodes.Add("C#");
 treeView1.Nodes[0].Nodes[3].Nodes.Add("vb.net");
 }
 }
 }
Methods( )
 Hide( )
hide the control from the user.(Inherited from Control).
 HitTest(Int32, Int32)
Provides node information, given x- and y-coordinates.
 OnBackColorChanged(EventArgs)
Raises the BackColorChanged event.(Inherited from Control.
 OnParentVisibleChanged(EventArgs)
Raises the VisibleChanged event when the Visible property value
of the control's container changes.(Inherited from Control.

More Related Content

What's hot

Java Script Object Notation (JSON)
Java Script Object Notation (JSON)Java Script Object Notation (JSON)
Java Script Object Notation (JSON)Adnan Sohail
 
Vb decision making statements
Vb decision making statementsVb decision making statements
Vb decision making statementspragya ratan
 
Control structures functions and modules in python programming
Control structures functions and modules in python programmingControl structures functions and modules in python programming
Control structures functions and modules in python programmingSrinivas Narasegouda
 
Javascript - Array - Creating Array
Javascript - Array - Creating ArrayJavascript - Array - Creating Array
Javascript - Array - Creating ArraySamuel Santos
 
10. array & pointer
10. array & pointer10. array & pointer
10. array & pointer웅식 전
 
Python Web Development Tutorial | Web Development Using Django | Edureka
Python Web Development Tutorial | Web Development Using Django | EdurekaPython Web Development Tutorial | Web Development Using Django | Edureka
Python Web Development Tutorial | Web Development Using Django | EdurekaEdureka!
 
Web programming PHP BCA 313
Web programming PHP BCA 313Web programming PHP BCA 313
Web programming PHP BCA 313cpjcollege
 
Array of objects.pptx
Array of objects.pptxArray of objects.pptx
Array of objects.pptxRAGAVIC2
 
C# Variables and Operators
C# Variables and OperatorsC# Variables and Operators
C# Variables and OperatorsSunil OS
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessingksamyMCA
 
ORM: Object-relational mapping
ORM: Object-relational mappingORM: Object-relational mapping
ORM: Object-relational mappingAbhilash M A
 
Object-Oriented Polymorphism Unleashed
Object-Oriented Polymorphism UnleashedObject-Oriented Polymorphism Unleashed
Object-Oriented Polymorphism UnleashedNaresh Chintalcheru
 

What's hot (20)

Threads in Java
Threads in JavaThreads in Java
Threads in Java
 
Data validation option
Data validation optionData validation option
Data validation option
 
Java file
Java fileJava file
Java file
 
Java Script Object Notation (JSON)
Java Script Object Notation (JSON)Java Script Object Notation (JSON)
Java Script Object Notation (JSON)
 
Vb decision making statements
Vb decision making statementsVb decision making statements
Vb decision making statements
 
Control structures functions and modules in python programming
Control structures functions and modules in python programmingControl structures functions and modules in python programming
Control structures functions and modules in python programming
 
Javascript - Array - Creating Array
Javascript - Array - Creating ArrayJavascript - Array - Creating Array
Javascript - Array - Creating Array
 
10. array & pointer
10. array & pointer10. array & pointer
10. array & pointer
 
C sharp
C sharpC sharp
C sharp
 
JSON
JSONJSON
JSON
 
Xml parsers
Xml parsersXml parsers
Xml parsers
 
Python Web Development Tutorial | Web Development Using Django | Edureka
Python Web Development Tutorial | Web Development Using Django | EdurekaPython Web Development Tutorial | Web Development Using Django | Edureka
Python Web Development Tutorial | Web Development Using Django | Edureka
 
Web programming PHP BCA 313
Web programming PHP BCA 313Web programming PHP BCA 313
Web programming PHP BCA 313
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
Array of objects.pptx
Array of objects.pptxArray of objects.pptx
Array of objects.pptx
 
C# Variables and Operators
C# Variables and OperatorsC# Variables and Operators
C# Variables and Operators
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
 
Graphics and Java 2D
Graphics and Java 2DGraphics and Java 2D
Graphics and Java 2D
 
ORM: Object-relational mapping
ORM: Object-relational mappingORM: Object-relational mapping
ORM: Object-relational mapping
 
Object-Oriented Polymorphism Unleashed
Object-Oriented Polymorphism UnleashedObject-Oriented Polymorphism Unleashed
Object-Oriented Polymorphism Unleashed
 

Similar to TrackBar and TreeView

Similar to TrackBar and TreeView (20)

Combo box and List box in VB.Net.ppt
Combo box and List box in VB.Net.pptCombo box and List box in VB.Net.ppt
Combo box and List box in VB.Net.ppt
 
Unit 5 swing & TREES
Unit 5 swing & TREESUnit 5 swing & TREES
Unit 5 swing & TREES
 
Oracle 10g Forms Lesson 6
Oracle 10g Forms Lesson  6Oracle 10g Forms Lesson  6
Oracle 10g Forms Lesson 6
 
Les06
Les06Les06
Les06
 
Unit2
Unit2Unit2
Unit2
 
Tree view
Tree viewTree view
Tree view
 
unit3.2 (1).pptx
unit3.2 (1).pptxunit3.2 (1).pptx
unit3.2 (1).pptx
 
Creating a dot netnuke
Creating a dot netnukeCreating a dot netnuke
Creating a dot netnuke
 
Mca 504 dotnet_unit5
Mca 504 dotnet_unit5Mca 504 dotnet_unit5
Mca 504 dotnet_unit5
 
Data_Processing_Program
Data_Processing_ProgramData_Processing_Program
Data_Processing_Program
 
The Ring programming language version 1.3 book - Part 5 of 88
The Ring programming language version 1.3 book - Part 5 of 88The Ring programming language version 1.3 book - Part 5 of 88
The Ring programming language version 1.3 book - Part 5 of 88
 
Winforms
WinformsWinforms
Winforms
 
Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training
 
Maliram poonia project
Maliram poonia projectMaliram poonia project
Maliram poonia project
 
Windows Programming with AWT
Windows Programming with AWTWindows Programming with AWT
Windows Programming with AWT
 
Csphtp1 12
Csphtp1 12Csphtp1 12
Csphtp1 12
 
Rational Publishing Engine with Rational DOORS
Rational Publishing Engine with Rational DOORSRational Publishing Engine with Rational DOORS
Rational Publishing Engine with Rational DOORS
 
tree view control
 tree view control tree view control
tree view control
 
Practicalfileofvb workshop
Practicalfileofvb workshopPracticalfileofvb workshop
Practicalfileofvb workshop
 
Session 3 Bai 3 ve winform
Session 3 Bai 3 ve winformSession 3 Bai 3 ve winform
Session 3 Bai 3 ve winform
 

Recently uploaded

Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 

Recently uploaded (20)

Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 

TrackBar and TreeView

  • 1. Topic Name: TrackBar & TreeView MUAHAMMAD WASEEM ASIM ROLL NO. 939
  • 2. TrackBar  The TrackBar control is a special slider control that allows the user to select a numeric value by changing the position of the slider.  The TrackBar is controlled mainly by three properties: Minimum, Maximum and Value.
  • 4. Properties of TrackBar  Size: Set the height and width of the control.  BackColor: Set the back color.  Visible: Hide / show property.  Value: The by default value of TrackBar Maximum is 10 and Minimum is 0.
  • 11. Visually Drag Drop  This will display the “New Project” dialog as shown below, where you should follow these steps: 1. Choose “Visual C#” from the list of templates on the left hand side of the dialog. 2. Choose the “Windows Forms Application” template from the center list. 3. Enter a name for the project. I’m using “Track.Bar”. 4. Uncheck the “Create directory for solution” box.
  • 12.
  • 13. Visually Drag Drop  Clicking on “Toolbox” on the left-hand side of the window, as shown below, will display the “Toolbox” panel. I find it convenient when I’m designing a form to click the push-pin at the upper right of the “Toolbox” panel so that it remains visible and is easier to access.  The TrackBar control is not in this list and you’ll need to expand the “All Windows Forms” and look for “TrackBar”, as shown to the right.
  • 14.
  • 15. Object Creation  using System;  using System.Collections.Generic;  using System.ComponentModel;  using System.Data;  using System.Drawing;  using System.Linq;  using System.Text;  using System.Threading.Tasks;  using System.Windows.Forms;  namespace TrackBar  {
  • 16. Object Creation…Continue  public partial class Form1 : Form  {  public Form1()  {  InitializeComponent();  }  private void trackBar1_Scroll(object sender, EventArgs e)  {  label1.Text = trackBar1.Value.ToString();  }  private void label1_Click(object sender, EventArgs e)  {  }
  • 17. Object Creation…Continue  private void Form1_Load(object sender, EventArgs e)  {  label1.Text = "0";  trackBar1.Maximum = 0;  trackBar1.Maximum = 200;  trackBar1.TickFrequency = 5;  }  }  }
  • 20. Object Creation…Continue  using System;  using System.Collections.Generic;  using System.ComponentModel;  using System.Data;  using System.Drawing;  using System.Linq;  using System.Text;  using System.Threading.Tasks;  using System.Windows.Forms;  namespace Track_Bar_with_picture_Box  {  public partial class Form1 : Form  {
  • 21. Object Creation…Continue  public Form1()  {  InitializeComponent();  }  private void Form1_Load(object sender, EventArgs e)  {  trackBar1.Minimum = 0;  trackBar1.Maximum = 400;  pictureBox1.Left = (ClientSize.Width - pictureBox1.Width) / 2;  pictureBox1.Top = (ClientSize.Height - pictureBox1.Height) / 2;  }  private void pictureBox1_Click(object sender, EventArgs e)  {  }
  • 22. Object Creation…Continue  private void trackBar1_Scroll(object sender, EventArgs e)  {  pictureBox1.Size = new Size(trackBar1.Value, pictureBox1.Size.Height);  pictureBox1.Left = (ClientSize.Width - pictureBox1.Width) / 2;  pictureBox1.Top = (ClientSize.Height - pictureBox1.Height) / 2;  }  }  }
  • 24. Events  Value: The by default value of TrackBar Maximum is 10 and Minimum is 0.  Minimum and Maximum: these two properties are used to define the range that the thumbs can scroll over.  i.e. trackBar1.Minimum = 0;  i.e. trackBar1.Maximum = 200;  LargeTickFrequency: this property is used to set the space between the large tick marks.  SmallTickFrequency: this property is used to set the space between the small tick marks.  i.e. trackBar1.TickFrequency = 5;
  • 25. Use
  • 27. TreeView  The TreeView control contains a hierarchy of TreeViewItem controls. It provides a way to display information in a hierarchical structure by using collapsible nodes . The top level in a tree view are root nodes that can be expanded or collapsed if the nodes have child nodes.
  • 29. Properties of TreeView  BackColor: Gets or sets the background color of the tree node.  Bounds: Gets the bounds of the tree node.  Checked: Gets or sets a value indicating whether the tree node is in a checked state.  FirstNode: Gets the first child tree node in the tree node collection.  ForeColor: Gets or sets the foreground color of the tree node.
  • 30. Properties of TreeView  FullPath: Gets the path from the root tree node to the current tree node.  Handle: Gets the handle of the tree node.  ImageIndex: Gets or sets the image list index value of the image displayed when the tree node is in the unselected state.  ImageKey: Gets or sets the key for the image associated with this tree node when the node is in an unselected state.
  • 31. Visually Drag Drop  This will display the “New Project” dialog as shown below, where you should follow these steps: 1. Choose “Visual C#” from the list of templates on the left hand side of the dialog. 2. Choose the “Windows Forms Application” template from the center list. 3. Enter a name for the project. I’m using “TreeView”. 4. Uncheck the “Create directory for solution” box.
  • 32.
  • 33. Visually Drag Drop  Clicking on “TreeView” on the left-hand side of the window, as shown below, will display the “Toolbox” panel. I find it convenient when I’m designing a form to click the push-pin at the upper right of the “Toolbox” panel so that it remains visible and is easier to access.  The TrackBar control is not in this list and you’ll need to expand the “All Windows Forms” and look for “TreeView”, as shown to the right.
  • 34.
  • 35. Constructors  TreeView() Initializes a new instance of the TreeView class.
  • 36. Object Creation  using System;  using System.Collections.Generic;  using System.ComponentModel;  using System.Data;  using System.Drawing;  using System.Linq;  using System.Text;  using System.Threading.Tasks;  using System.Windows.Forms;  namespace TreeView1  {
  • 37. Object Creation…Continue  public partial class Form1 : Form  {  public Form1()  {  InitializeComponent();  TreeNode tNode;  tNode = treeView1.Nodes.Add("Welcome...");  }  private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)  {
  • 38. Object Creation…Continue  treeView1.Nodes[0].Nodes.Add("Windows");  treeView1.Nodes[0].Nodes[0].Nodes.Add("Windows 7");  treeView1.Nodes[0].Nodes[0].Nodes.Add("Windows 8");  treeView1.Nodes[0].Nodes[0].Nodes[1].Nodes.Add("Windows 8.1");  treeView1.Nodes[0].Nodes.Add("Operating System");  treeView1.Nodes[0].Nodes[1].Nodes.Add("Unix");  treeView1.Nodes[0].Nodes[1].Nodes.Add("Linux");  treeView1.Nodes[0].Nodes.Add("Database");  treeView1.Nodes[0].Nodes[2].Nodes.Add("ORACLE");  treeView1.Nodes[0].Nodes[2].Nodes.Add("SQL SERVER");
  • 39. Object Creation…Continue  treeView1.Nodes[0].Nodes.Add(".net language");  treeView1.Nodes[0].Nodes[3].Nodes.Add("C#");  treeView1.Nodes[0].Nodes[3].Nodes.Add("vb.net");  }  }  }
  • 40.
  • 41. Methods( )  Hide( ) hide the control from the user.(Inherited from Control).  HitTest(Int32, Int32) Provides node information, given x- and y-coordinates.  OnBackColorChanged(EventArgs) Raises the BackColorChanged event.(Inherited from Control.  OnParentVisibleChanged(EventArgs) Raises the VisibleChanged event when the Visible property value of the control's container changes.(Inherited from Control.