Title: VISUAL BASIC 2005 EXPRESS
1VISUAL BASIC 2005 EXPRESS
- - Lakoca programiranja -
- Dragan Jankovic
- Katedra za Racunarstvo
- Elektronski fakultet, Niš
2(No Transcript)
3Sve to može ovako
4A može i ovako
5(No Transcript)
6RAD ?
- Brzo ucenje
- Motivacija
- Brz i efikasan razvoj aplikacija
- Gotovi elementi interfejsa
- Programiranje upravljano dogadjajima
- Programiranje mišem
- Drag Drop
- Podesi
- Dopuni
7Jednostavnije i efikasnije
Basic
8Visual Basic .NET
- Unapredjen jezik
- Potpuno podržana OO paradigma
- Klase, nasledivanje, konstruktori, destruktori
- Overloading, polimorfizam, ...
- Obrada izuzetaka
- Potpuni pristup .NET frameworku
- Multithread, garbage collection
- Unapredjen razvoj Web apikacija
- Kreiranje Web formi po ugledu na Windows forme
- Kreiranje Web servisa jednostavno
- Poboljšan security
- Jednostavan i fleksibilan deployment
9Å ta je novo?
- IntelliSense Filtering
- IntelliSense in Zone
- New VB Item Templates
- Find References
- Exportable Development Settings
- Simplified Tools -gt Options
- Project Designer
- Starter Kits
- XML Editor
- Zero Impact Projects
- Start Page
- Authenticode signing support
- Custom Setup Bootstrapper
- Big 5 Bootstrapper packages(Fx 2.0, SSE, etc.)
- Strongly typed Resources
-
- Edit and Continue
- My
- Generics
- Click Once
- Data Sources Windows
- Object Binding
- Web Service Binding
- Debugger Visualizers
- Just My Code Debugging
- The Exception Assistant
- Design Time Expression Evaluation
- IntelliSense Code Snippets
- XML Comments
- Error Correction and Warnings
- Rename
- Attribute Editing
10- Lookup table binding
- Upgrade WebBrowser
- Upgrade Masked Edit
- Upgrade Rich textbox
- Upgrade Windows Common Controls
- TreeView, ListView, ImageList
- ToolBar, StatusBar, ProgressBar
- Upgrade Common Dialogs
- Upgrade MTS/COM Projects
- Upgrade BackgroundImageLayout Property
- Upgrade keys in KeyPress event
- Upgrade additional Keywords
- Updated Keys In Control Collections
- Upgrade Unload Mode in FormClosing Event
- Registration Free COM
- Strongly typed Settings
- Using statement
- Continue statement
- Global keyword
- Accessor accessibility
- Partial types
- Unsigned types
- Operator overloading
- Warnings
- Custom Events
- TableAdapters
- DataSet Designer
- Drag Once Form creation
- Smart Tags
- Parameterized query
- Connect the Dots databinding
- Custom Control drag / drop
11Nešto više o ...
- Generics
- Partial Types
- IsNot
- Continue
- Operator overloading
- My Object (namespace)
- Code Snippets
-
12Generics
Private _Items As Collection Private Sub
Class_Initialize() Set _Items New
Collection End Sub Private Sub
Class_Terminate() Set _Items Nothing End
Sub Public Function NewEnum() As
stdole.IUnknown Set NewEnum moItems._NewEnum
End Function Public Function Item(Key As String)
As Person On Error Resume Next Set Item
_Items.Item(Key) End Function Public Property
Get Count() As Long Count _Items.Count End
Property Public Sub Add(Person As Person, Key
As String) _Items.Add Text, Text.Key End
Sub Public Sub Remove(Index As Integer)
_Items.Remove Index End Sub
VB6
Public Class Cars Inherits CollectionBase
Public Sub Add(ByVal item As Person)
MyBase.InnerList.Add(item) End Sub Default
Property Item(ByVal index As Integer) As Person
Get Return DirectCast(MyBase.InnerList(index),
Person) End Get Set(ByVal Value As Person)
MyBase.InnerList(index) Value End Set End
Property End Class
VB.NET
VB2005
Dim Cars As New List(Of Car) Cars.Add(New Car())
13Zašto Generics?
- Kod tipiziran
- Izbegnute run-time greške
- IntelliSense radi
- Bolje performanse
- Primer Efikasnost realizacije primenom
- Array 344
- ArrayList 4656
- Generic List 797
14Partial Types
File Class1.vb Public Class Car Public Sub
Start() End Sub End Class
Dim T As New Car() T.Start() T.Stop()
File Class2.vb Public Partial Class Car Public
Sub Stop() End Sub End Class
15IsNot Operator
Public Sub Test(ByVal o As SomeType) If Not o
Is Nothing Then o.DoSomething() Else
Throw New NullReferenceException() End If End
Sub
Public Sub Test(ByVal o As SomeType) If o IsNot
Nothing Then o.DoSomething() Else Throw
New NullReferenceException() End If End Sub
16Continue
Dim i, j, k As Int32Dim rnd As New
Random(DateTime.Now.Millisecond)For i 0 To
5Â j 0Â While (j lt 3)Â Â j 1Â Â k 0Â Â
Do   k 1   If (rnd.Next(100) gt 90) Then
Continue For  Loop Until k gt j End While
Debug.WriteLine(String.Format("0 1 2", i,
j, k))Next
For i as Int320 to 10 If (i mod 2 0 ) Then
Continue For Debug.WriteLine(i) 1,3,5,7,9 Next
17Overloading operatora
Public Class SetPoint Public Temperature as
Single Public Sub New (value as Single)
Me.Temperaturevalue End Sub Public Shared
Operator (ByVal a As SetPoint,_ ByVal b
As SetPoint) As SetPoint Return New
SetPoint(a.Temperature b.Temperature) End
Operator End Class
Public Class SetPoint Public Temperature as
Single Public Sub New (value as Single)
Me.Temperaturevalue End SubEnd Class
Dim T1 as New SetPoint(12.5)Dim T2 as New
SetPoint(13)Dim T3 as SetPoint T1 T2
18Overloading operatora(2)
Public Class Complex Public Real As Double
Public Imag As Double Public Sub New(ByVal rp
As Double, ByVal ip As Double) Real rp
Imag ip End Sub Shared Operator (ByVal
lhs As Complex, ByVal rhs As Complex)_ As
Complex Return New Complex(lhs.Real
rhs.Real, lhs.Imag rhs.Imag) End Operator End
Class 'new Complex operator works
intuitively Dim lhs As Complex New
Complex(2.1, 3.3) Dim rhs As Complex New
Complex(2.5, 4.6) Dim res As Complex lhs
rhs 'res.real 4.6, res.imag 7.9
19My Namespace
Application title, version, logs, description,
Registry, Printer, Audio, File System,
User name, group, domain,
Pristup resursi aplikacije icons, images,
User i application settings
Kolekcija formi u aplikaciji, show / hide
Jednostavan pristup web servisima ukjucenim u
projekat (Web references)
20(No Transcript)
21- My.Resources
- PictureBox1.Image My.Resources.Logo
- My.Settings
- My.Settings.FormLocation Me.Location
- My.Forms
- My.Forms.Form1.Show
- My.WebServices
- My.WebServices.MSDN.Search(VB)
22Code Snippets
Desni-klik u editoru koda i selekcija taska
izaziva insetovanje ranije pripremljenog koda.
23Start Page u VB 2005 Express
24Prikaz Web strane
25New Project dijalog
26Design mode
27Meni
28Meni (nastavak)
29Toolbar
30Help
- Dinamicki help
- Context-Sensitive Help
31Komande Help menija
32Dinamicki help
33Context sensitive help
34Kako uciti?
- 2373B Programming with Microsoft Visual Basic
.NET - Microsoft IT Academy Elektronski fakultet u
Nišu - PIL programMicrosoft Software ELEF
- Portal www.pil-vb.net
- Dušan Vuckovic, Elektronski fakultet, Niš
- dvuckovic_at_elfak.ni.ac.yu
- gaga_at_elfak.ni.ac.yu
35(No Transcript)
36(No Transcript)
37VB.NET 2005
38(No Transcript)