if we want to make our code short and easy then With Block is a very nice choise in some cases. Consider the following code for loading picture in a picture box. On Error Resume Next
CommonDialog1.CancelError = True
CommonDialog1.Filter = "Pictures (*.bmp;*.jpg)|*.bmp;*.jpg"
CommonDialog1.Flags = cdlOFNFileMustExist
CommonDialog1.ShowOpen
If Err.Number = cdlCancel Then
Exit Sub
ElseIf Err.Number <> 0 Then
MsgBox "Error Loading File"
End If
Picture1.Picture = LoadPicture(CommonDialog1.FileName) You may notice that there are a lot of name I have written repeating again and again which may become boring sometime. What about some shortcut. With block is the answer. we can replace the same code as following easyl which is more convenient.
On Error Resume Next
With CommonDialog1
.CancelError = True
.Filter = "Pictures (*.bmp;*.jpg)|*.bmp;*.jpg"
.Flags = cdlOFNFileMustExist
.ShowOpen
If Err.Number = cdlCancel Then
Exit Sub
ElseIf Err.Number <> 0 Then
MsgBox "Error Loading File"
End If
Picture1.Picture = LoadPicture(.FileName)
End With With block must need to be closed with "End With".
I believe visual studio is the user interface, and it not only supports visual basic but also visual c++, c#, web development etc. Visual basic, on the other hand, is a programming language.
Visual Basic 1.0 is copyright (c) 1991 Microsoft Corporation, if that's any help. VISUAL BASIC was invented in 1991
C# its Very Sharp VB-Visual Basic Extension for BASIC C# its Very Sharp VB-Visual Basic Extension for BASIC
By Spelling XD
I guess Visual Basic was invented for people to make their own programs and also to have an interest in programming or computer science.
Objects are the fundamental building block of Visual Basic; nearly everything you do in Visual Basic involves modifying objects. Every element of Microsoft Word - documents, tables, paragraphs, bookmarks, fields and so on - can be represented by an object in Visual Basic.
Visual Basic Controls work on Visual Studio for Visual Basic and Applications that made by Visual Basic.
Visual Basic was started in 1991.
Microsoft is the developer of visual basic
Visual Basic was created by a team at Microsoft.
The programming language: Visual Basic is a BASIC-like (or BASIC-derived) language, Visual C is... well C.
No.
Microsoft is the developer of Visual Basic.
Visual Basic was started in 1991.
Visual Basic 2005 is actually a version of VB.NET (v8.0). The latest version (9.0) is Visual Basic 2008.
Visual Basic 6.0 Product Key
arrays programms in visual basic