Search VB 2010

Showing posts with label Visual Basic Class. Show all posts
Showing posts with label Visual Basic Class. Show all posts

Monday, July 01, 2013

Visual Basic Online Course OOP Classes

Visual Basic Application Development
Object Oriented Programming 

Introduction

After creating so much applications and working with Databases, I was always afraid of getting close to OOP (Object Oriented Programming). OOP is the essence of Programming languages, understanding OOP is a sign which tells you "You are a talented programmer". 

We all know that there is a difference between programming practitioner and freelancer programmer, some say that practitioners are much secure, they don't need to learn more to get paid because they already have a job, but a freelancer is a guy who is talented in something (In this example : Programming) and in addition he/she wants to make something out of it.
VB 2010 OOP
VB 2010 OOP
OOP or Object Oriented Programming, means programming the programming, Yes! Before studying OOP we used to write codes and place tools, then hoke them up together to come up with something magnificent for ourselves or for our clients for money or some school degrees as a project.

No client will ever ask you to create a programming tool for him, or to modify a built-in tool for him, unless he is another programmer trying to sell something over the internet, if you ever worked in a freelance agency such as for example Freelancer.com, Odesk.com or Vworker.com those and others are major hiring websites for freelancers, not just in programming field but in so much things.

Each and every desktop application written and designed in Visual Basic .Net includes for most of us, basic interfaces : The form, the controls on the form, coding the controls, packing all above, to come up in the end with an application, well this is not exactly how it works in OOP programming.

In OOP programming you create your own everything from scratch to start using it in your form or coding controls on the form or creating controls (TextBoxes, Labels, ..... etc.) for yourself for later work. OOP is written within a Class.

Since .Net Framework started, and almost everything in Visual Basic became a separate Class of its own. Notice when you open the form to write a code, the first line says (Public Class Form1) then in the end (End Class).

A Class is the mother and the father of each and single object in Visual Basic .Net, everything you see in Visual Basic .Net came from a Class. To create a Class, you need to need to create a Class, I'm not kidding, I mean it, if you want to create a Class in your project then you must need one unless it won't make any sense, since logic is key stone and the only motivation for programmers to start designing coding, and Classes is one of those jobs as designing and coding then logic (The need for creating a Class) must be present in order to succeed and make sense.

VB 2010 OOP
VB 2010 OOP

When do we need to create a Class for our Visual Basic .Net Project ?

If you are trying to create your own Textbox or label, or if you are generally trying to create your own Visual Basic .Net Control, then you are definitely in need for a Class, as a result, you need to know OOP.

If you developed a method with a 3rd party for example, and you need to always include this method in further applications, then you need to create a Class for yourself, and also as a result you will have to learn and read about OOP.

Last thing, the basic thing to need to create a Class is when you are trying to contain your code blocks into a container for further development, then you need a Class.

VB 2010 OOP
VB 2010 OOP
Yes, all we need now is an example of a Class to start working. See you next chapter.

Here are some online Visual Basic lessons and courses :

Thursday, October 11, 2012

Visual Basic Online Course ProgressBar

Visual Basic 2010 ProgressBar Control 

VB2010 Progress bar - Visual Basic Online Course

 Using the ProgressBar control Example :

- Create New Windows Project
- Button1
- ProgressBar1
- Logic : We will generate 4 MessageBoxes by clicking the Button1 Control and everytime a messagebox shows up, a ProgressBar step will be taken.

Progress Bar Class : In .Net Framework4.0

A ProgressBar control consists of a window that is filled, by default from left to right, as an operation progresses. The control has a range and a current position.
ProgressBar overrides the metadata of the Maximum property and sets its default to 100. ProgressBar overrides the metadata of the Focusable property and sets its default to false. For more information, see Dependency Properties Overview.

Customizing the ProgressBar Control

To apply the same property settings to multiple ProgressBar controls, use the Style property. You can modify the default ControlTemplate to give the control a unique appearance. For more information about creating a ControlTemplate, see Customizing the Appearance of an Existing Control by Creating a ControlTemplate. To see the parts and states that are specific to the ProgressBar, see ProgressBar Styles and Templates.
Dependency properties for this control might be set by the control’s default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. For more information, see Default WPF Themes.

NoteNote
Setting a visual property will only have an effect if that property is both present in ProgressBar control's default template and is set by using a TemplateBinding. You can find a list of visual properties in the "Changing the Visual Structure of a Control" section in Customizing the Appearance of an Existing Control by Creating a Control Template.

How to call a Progress Bar from a Module in VB 2010

In addition to our example about Progress Bar, what if we wanted to code the progress bar to call it from another level [Module Level] !

Create Visual Basic 2010 Windows Form Application
Place a Progressbar (Progressbar1) control on the Form (Form1
Add new Module (Module1)

Code :

Now, run your application and click on any part of the Form1, you will notice that the ProgressBar is working.

Visual Basic Courses - Share