Search VB 2010

Showing posts with label visual basic online course. Show all posts
Showing posts with label visual basic online course. Show all posts

Sunday, April 13, 2014

VB 2010 Crystal Reports Errors

Visual Basic Online Course - Crystal Reports for VB2010 Errors and Solutions

Error (1)
Could not load file or assembly 'file:///C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet1\crdb_adoplus.dll' or one of its dependencies. The system cannot find the file specified. how can solve this error in windows application 
 Solution
Add those lines to your App.Config file located in your VB2010 Solution Explorer Panel
and Run your application again.


Error (2)
Crystal Reports Database Login box. Some time Crystal Reports run perfectly on your machine (Developer Machine) but after deploying it and install it on another Machine, it gives you an error like this :
VB2010 Crystal Reports Database Location Error
 Solution
Add those lines to your Form_Load where the report is being loaded to adjust the Database location (Microsoft Access 2003 Database) :

Error (3)
Crystal Reports 2010 doesn't insert pictures manually. When you try to insert a photo into the Crystal Reports 2010 it doesn't take any action. Inserting pictures in Crystal Reports 2010 doesn't work.
Crystal Reports 2010 is not inserting images in the report
Crystal Reports 2010 is not inserting images in the report
 Solution
I've tried many sites and many solutions but I've never figured out the error pattern, or why does Crystal Reports not letting me insert any photo of any kind (JPEG, JPG, PNG) or resolutions. But I landed on this solution and it is working fine with me, and it seems the only solution I've now :
1) Right-click on the report while in the design
2) Choose Insert, then choose Picture
3) Single Left-click the on the photo you wish to insert
4) Click Open, you will notice the image box appears on the report
5) Place the Image box any where on the report and you will see it there.
- I used to double-click the image in the Dialog Box where I choose the Image but that did not work with me, now when I use 'Open', it is working 'Silly'

Error (4)
Crystal Reports 2010 Logon failed for Microsoft Access 2003/2007/2010 Protected Database with password.
This happens when we try to connect the Crystal Report with MS-Access Database in VB 2010 using the code (Programmatically).
Note that it won't happen we connect the Crystal Report with access protected database using the wizard, we just use the (Jet Database Password) field instead of (Database Password) field to provide the report with your Database Password.
VB 2010 Crystal Report MS-Access Password Protected Database
 But, to do this programmatically using code in VB 2010, you notice you always get "Logon Failed" Error message, using something like this :

And you get this error message :

 Solution
After many trials and tests, I've found out the only solution for this problem is to connect dynamically to Crystal Reports in VB 2010 using code is through the DataSet and DataTable Objects, here is the code to accomplish this :

Here is a full example on :
- Connecting protected MS-Access 2007 database with VB 2010
- Insert Data into Database fields
- Delete Data from Database Table
- Connect Crystal Report with VB 2010 and MS-Access protected Database Programmatically
- Update Crystal report without problems when updating MS-Access protected Database.

Wednesday, February 12, 2014

Visual Basic Online Course - Make sure application is running and installed



Visual Basic Online Course

How to make sure that an Application is Running and Installed

VB 2010 Make sure application is running
Visual Basic Online Course - Tips

When you create a Visual Basic 2010 or generally a VB.Net application that relies on another VB.Net application for example an Updater.exe application, you will have to code both sides in order no to enable the user to run Updater.exe without the existence of the Main application, and in order to do so, you will have to make sure that :
1) Your Main application is Running.
2) Your Main application is Installed.
3) Your Main application does exist in the installation folder.
After making sure of all the above points, then you can compile your updater.exe file with your Main Application knowing that updater.exe won't run alone, especially if you're sending updates to the Main application for the user to receive using Updater.exe.

Here are the code to do so :
1) VB 2010 Get list of all installed applications

2) VB 2010 Get list of all running applications

3) VB 2010 Make sure application exists

Thank you for reading, download VB 2010 Project from here

Here are some online Visual Basic lessons and courses :

Wednesday, February 05, 2014

Visual Basic Online Course - Read Text File

Visual Basic 2010 - How to Read Text File(s)

VB 2010 Read Text Files
VB 2010 Read Text Files
Introduction

In order to read from a Text File then a Text File has to be present (Present = Known Path), the path of a Text File is just like any other path of any file it is String, for example :
C:\Folder\File.txt
The path to the File.txt is (C:\Folder\File-Name.Extension), so the path to the File Text = Path + File-Name + extension. Text Files can be present locally (on the same machine) or from external place (on the web) for example :
ftp://10.0.0.27/Folder/File.txt
As long as this Path is present and accessible then Reading Text File in VB 2010 is just so easy job to do. We can store the path to the Text File into a String variable to use it in our VB 2010 project :
Dim LocalFilePath as String = ("C:\Folder\File.txt")
Dim WebFilePath As String = ("ftp://10.0.0.27/Folder/File.txt")
The problem with Text Files hosted on the web, is that it has to be accessible in order to read it or write it, you have to provide  a User Name and Password to gain access to those files for most of the times because of security issues, unlike reading Text Files from local storage devices, there is no need to provide credentials or authentications to be able to read them.

Reading from Local Text Files in VB 2010

We will use File Reader to read String stored in a Text File,we will use basics of reading Text Files.

1) Create VB 2010 Windows Form Project (WindowsApplication1) and save it to (D:\)
2) Add TextBox (Name : TxtFromFile, MultiLine : True)
3) Create Text File (MyFile.txt) and place it in the project folder
Path to MyFile.txt is (D:\WindowsApplication1\Bin\Debug\)
4) Write to MyFile.txt those two lines :
Hello
Visual Basic Online Course
5) Save and close the file.

Now, the project will :
Open the Text File to read on the Form_Load() event
Displays the String in the TextBox (TxtFromFile)

Code


Here are some online Visual Basic lessons and courses :

Sunday, February 02, 2014

Visual Basic Online Course Fade Image

Fade Image in VB 2010

VB 2010 Fade Image
VB 2010 Fade Image
How to fade image in Visual Basic 2010

It doesn’t matter if you are a photographer or a graphic designer, chances are that you have come across the need to fade or blend images in Visual Basic 2010. You can always use Photoshop to create faded images and then use them in your VB 2010 applications, but as a developer you also have to know what does it take to do so, not just to fade an Image but also as a general, after all it's your job to come up with answers.

In our demonstration here well will use ordinary common tools in VB 2010 to be able to fade an Image.

Project Design
 
VB 2010 Example to Fade Image
VB 2010 Example to Fade Image
Form
Name : Form1
Text : Fade Image in VB 2010
PictureBox
Name : PicToFade
BackColor : Transparent
Dock : Full
Timer
Name : Timer1
Interval : 100

How does it work 

Run the application, click on the PicToFade [PictureBox], it will show the [OpenFileDialog] choose and Image [JPEG] and then notice that it will begin to fade away.

You can alter the code to change the fading values [Alpha from 0 to 1 and DeltaAlpha], you can use a Progressbar control to change the fading values too.

Source Code

Download Source Code
MediaFire.com fade image

Here are some online Visual Basic lessons and courses :

Wednesday, January 15, 2014

Visual Basic 2010 Read/Write Command Prompt

Visual Basic Online Course - Command Prompt

Read / Write Windows Command Prompt from VB 2010

Read / Write Windows Command Prompt from Visual Basic 2010

Command Prompt

A command prompt is an entry point for typing computer commands in the Command Prompt window. By typing commands at the command prompt, you can perform tasks on your computer without using the Windows graphical interface.

Command Prompt Commands

(A)
ADDUSERS Add or list users to/from a CSV file
ARP Address Resolution Protocol
~ ASSOC Change file extension associations
ASSOCIAT One step file association
AT Schedule a command to run at a later time
ATTRIB Change file attributes

(B)
BOOTCFG Edit Windows boot settings
BROWSTAT Get domain, browser and PDC info

(C)
CACLS Change file permissions
~ CALL Call one batch program from another
~ CD Change Directory - move to a specific Folder
CHANGE Change Terminal Server Session properties
CHKDSK Check Disk - check and repair disk problems
CHKNTFS Check the NTFS file system
CHOICE Accept keyboard input to a batch file
CIPHER Encrypt or Decrypt files/folders
CleanMgr Automated cleanup of Temp files, recycle bin
CLEARMEM Clear memory leaks
CLIP Copy STDIN to the Windows clipboard.
~ CLS Clear the screen
CLUSTER Windows Clustering
CMD Start a new CMD shell
~ COLOR Change colors of the CMD window
COMP Compare the contents of two files or sets of files
COMPACT Compress files or folders on an NTFS partition
COMPRESS Compress individual files on an NTFS partition
CON2PRT Connect or disconnect a Printer
CONVERT Convert a FAT drive to NTFS.
~ COPY Copy one or more files to another location
CSCcmd Client-side caching (Offline Files)
CSVDE Import or Export Active Directory data

(D)
~ DATE Display or set the date
Dcomcnfg DCOM Configuration Utility
DEFRAG Defragment hard drive
~ DEL Delete one or more files
DELPROF Delete NT user profiles
DELTREE Delete a folder and all subfolders
DevCon Device Manager Command Line Utility
~ DIR Display a list of files and folders
DIRUSE Display disk usage
DISKCOMP Compare the contents of two floppy disks
DISKCOPY Copy the contents of one floppy disk to another
DISKPART Disk Administration
DNSSTAT DNS Statistics
DOSKEY Edit command line, recall commands, and create macros
DSADD Add user (computer, group..) to active directory
DSQUERY List items in active directory
DSMOD Modify user (computer, group..) in active directory

(E)
~ ECHO Display message on screen
~ ENDLOCAL End localisation of environment changes in a batch file
~ ERASE Delete one or more files
~ EXIT Quit the current script/routine and set an errorlevel.
EXPAND Uncompress files
EXTRACT Uncompress CAB files

(F)
FC Compare two files
FIND Search for a text string in a file
FINDSTR Search for strings in files
~ FOR /F Loop command: against a set of files
~ FOR /F Loop command: against the results of another command
~ FOR Loop command: all options Files, Directory, List
FORFILES Batch process multiple files
FORMAT Format a disk
FREEDISK Check free disk space (in bytes)
FSUTIL File and Volume utilities
FTP File Transfer Protocol
~ FTYPE Display or modify file types used in file extension associations

(G)
GLOBAL Display membership of global groups
~ GOTO Direct a batch program to jump to a labelled line

(H)
HELP Online Help 

(I)
~ IF Conditionally perform a command
IFMEMBER Is the current user in an NT Workgroup
IPCONFIG Configure IP

(J)
KILL Remove a program from memory

(L)

LABEL Edit a disk label
LOCAL Display membership of local groups
LOGEVENT Write text to the NT event viewer.
LOGOFF Log a user off
LOGTIME Log the date and time in a file

(M)

MAPISEND Send email from the command line
MBSAcli Baseline Security Analyzer.
MEM Display memory usage
~ MD Create new folders
MKLINK Create a symbolic link (linkd)
MODE Configure a system device
MORE Display output, one screen at a time
MOUNTVOL Manage a volume mount point
~ MOVE Move files from one folder to another
MOVEUSER Move a user from one domain to another
MSG Send a message
MSIEXEC Microsoft Windows Installer
MSINFO Windows NT diagnostics
MSTSC Terminal Server Connection (Remote Desktop Protocol)
MUNGE Find and Replace text within file(s)
MV Copy in-use files

(N)
NET Manage network resources
NETDOM Domain Manager
NETSH Configure network protocols
NETSVC Command-line Service Controller
NBTSTAT Display networking statistics (NetBIOS over TCP/IP)
NETSTAT Display networking statistics (TCP/IP)
NOW Display the current Date and Time
NSLOOKUP Name server lookup
NTBACKUP Backup folders to tape
NTRIGHTS Edit user account rights

(P)
~ PATH Display or set a search path for executable files
PATHPING Trace route plus network latency and packet loss
~ PAUSE Suspend processing of a batch file and display a message
PERMS Show permissions for a user
PERFMON Pe

Example 

1) Copy / Paste filesCopy - This command allows you to copy files from one location to another. To use this command you would type
copy filetocopy copiedfile
For example if you have the file D:\test\test.txt and would like to copy it to c:\windows\test.txt you would type
copy D:\test\test.txt c:\windows\test.txt
and press enter. 
If the copy is successful it will tell you so and give you back the prompt. If you are copying within the same directory you do not have to use the path. 

Here are some examples and what they would do:
copy File.txt ThisFile.bak     Copies the File.txt file to a new file called ThisFile.bak in the same directory
copy File.txt \windows     Copies the File.txt file to the \windows directory.
copy * \windows     Copies all the files in the current directory to the \windows directory.

Redirectors

Re-directors are an important part to using the command prompt as they allow you to manipulate how the output or input of a program is displayed or used. Re-directors are used by appending them to the end of a command followed by what you are redirecting to. For example: Dir > DirOutPuts.txt. There are four re-directors that are used in a command prompt and they are discussed below:

>     This re-director will take the output of a program and store it in a file. If the file exists, it will be overwritten. If it does not exist it will create a new file. For example the command dir > DirOutPuts.txt will take the output of the Dir command and place it in the DirOutPuts.txt file. If dir.txt exists, it will overwrite it, otherwise it will create it.

>>     This re-director will take the output of a program and store it in a file. If the file exists, the data will be appended to the current data in the file rather than overwriting it. If it does not exist it will create a new file. For example the command dir >> dir.txt will take the output of the dir command and appends it to the existing data in the Dir.txt file if the file exists. If dir.txt does not exist, it will create the file first.

<     This re-director will take the input for a program from a specified file. For example the date command expects input from a user. So if we had the command date < date.txt, it would take the input for the date program from the information contained in the date.txt file.

|     This re-director is called a pipe. It will take the output of a program and pipe it into another program. For example Dir | sort would take the output of the dir command and use it as input to the sort command.

How do we use of those info in Visual Basic 2010 ?

There are so many benefits of using Command Prompt Commands in VB 2010, I will give an example of comparing two EXE file (Windows Application) using FC command from VB 2010 which I know is needed most by many developers, there are some tools that actually do that and are based on the usage of FC command.

Example : Compare two applications is called Binary Diff. , FC command operate a comparison process based on the location of the two *.exe files and return the result like this :
xxxxxx: yy zz
The value of xxxxxx specifies the relative hexadecimal address for the pair of bytes, measured from the beginning of the file. Addresses start at 00000000.
The hexadecimal values for yy and zz represent the mismatched bytes from filename1.exe and filename2.exe , respectively.

Syntax :
FC  [drive1:][path1]filename1.exe [drive2:][path2]filename2.exe /B
[drive1:][path1]filename1 : Specifies the location and name of the first file you want to compare. Filename1 is required.
[drive2:][path2]filename2 : Specifies the location and name of the second file you want to compare. Filename2 is required. 
/B  : Compares the files in binary mode. FC compares the two files byte by byte and does not attempt to resynchronize the files after finding a mismatch. This is the default mode for comparing files that have the following file extensions: .exe, .com, .sys, .obj, .lib, or .bin.

To make use of the example :
Create any Visual Basic 2010 Project [Windows Form]
Build it, so you would have an EXE file in Bin\Debug
Copy the exe file to another Dir called C:\Comp, and rename it to (CS.exe)
Edit your Visual Basic 2010 Source Code (Add any line of code)
Build menu : Clear Solution
Build menu : Build solution
now you have another version of the exe file
Rename your recent exe file (Cexe.exe) and paste it in C:\Comp folder with the previous exe file
Now you have 2 different exe (CS.exe and Cexe.exe) files in C:\Comp folder and we want to compare them as Binary Diff.

Create new VB 2010 Project, like this :
VB 2010 Command Prompt
Compare two windows applications in VB 2010 using Command Prompt FC Command
Form
Name : form1
Caption : Compare two exe files
TextBox
'Contains the command Line FC
Name : TextBox1
MultiLine : True
Text :
@Echo Off
FC C:\comp\CS.exe C:\comp\Cexe.exe /B
TextBox
'Will contain the Comparison result of the two EXE application files.
Name
: TextBox2
MultiLine : True
Text :Comparison Result will display here ...
Button
'Executes the Command Line FC in the TextBox1
Name : Button1
Text : Go

Visual Basic Code : Open code area, clear it and paste the following codes ....

Run your application. The result will be like this :
VB 2010 Binary Diff example
Comparison Result of Comparing two windows applications using FC command from VB 2010
You can extend your work further and further ..... If you have any questions please comment. Thank you for reading Visual Basic Online Course - Command Prompt

Here are some online Visual Basic lessons and courses :

Saturday, January 11, 2014

Visual Basic Freelance Requirements Document, Event Planning Document and Use Case Definition

Visual Basic Freelance Job - Understanding a client needs
Visual Basic Freelance Job - Understanding a client needs

Writing Requirements Document

 is a *.Pdf, *.Doc, *.Docs, *.Xml file describes what the your client needs from you "An Application" including but not limited to (Application Title, Purpose, Algorithms procedures and conditions, Notes and restrictions, Comments) these were the most famous requirements and your job as a programmer is to study well these points and design your applications according to it. Another way is to write it for your client if required, sometimes clients need to understand what you've done as a programmer, maybe they will hire some else in the future when you are not available.

This is different from VB .Net Documentations you won't be needing codes or anything, everything depends one the client's request or who ever requests it from you, as a programmer asked to provide this document, honesty is a must, you need to provide the client with everything, starting your logic to deploying methods and you shall accept to do it or not, it is controversial subject.

In the other hand 90% or Requirements Docs are provided by the client or requested by the contractor (Programmer) to ensure that his work (Application) will meet the client's demands to the fullest or at least almost the fullest.

The Requirements Doc. always/must be provided before the application's beginning by the client's to the programmer or along with the application by the programmer to the client.

Writing Event Planning Document 

is the same as the Requirements Doc. format file. It describes what is going on the application's interface UI, specifically describes what happens (The event) when the client's user will click on something on your form or the form_load event itself.
For example, if you have a button in your applicaiotn you will provide its name and the events that are bound to it (Click, DBLClick,. .... etc) and what happens when the client's perform an event of those above, most Planning Events Docs are tables design.

It is provided when requested and as the Requirements Doc. it is a controversial point of view between the prgrammer and the client, you may or you may not provide it if requested.

The VB .Net Event Planning Doc. always/must be provided if agreed by your side as a programmer (contractor), you will describe each and every control's event triggers in your application to the client.

The VB .Net Event Planning Doc. always provided to the client along with application or after, and may be designed and logically configuered by the programmer before writing the codes or designing the UI (User Interface), it should give a full understanding description to the methods used in desgining the User Interface and events related to each control.

Writing Use Case Definition 

is the same as the Requirements Doc. and the Event Planning Doc.'s format file. It describes the logic of/in the application you provide as a programmer to the client if requested. But this time it is a 50\50 chances, means it could be requested by the client or by you and also it should give you as a programmer the mean to reach the client's ideas about the application.

The Use Case Definition if requested by the programmer, means that the programmer is seeking the best image in the client's head and he wants to fully satisfies his client. If requested by the client means that the client already knows what he is seeking he is not just looking for a programmer, no! he is looking for a programmer to do this as he has in mind, maybe he already saw something and wants the exact same thing.

The Use Case Definition is more like terms to the programmer but also relieves him from over coding events that are not really needed ofcourse if asked by the client's side.

All of the 3 Documents ( Use Case Definition, equirements Doc and Event Planning Doc.) depends on the contract between you and the client. I will show you how to do it in a small application project using VB .Net 2010 as if provided\requested by a client soon.4

Here are some online Visual Basic lessons and courses :

Sunday, December 15, 2013

Visual Basic Compare Two Treeviews and return differences

Visual Basic 2010 - Compare Two Strings and return differences and matches

vb2010 compare strings and return differences
VB2010 Compare Strings in Collections

Collections as an Alternative to Arrays

Visual Studio 2010
Although collections are most often used for working with the Object Data Type, you can use a collection to work with any data type. In some circumstances, it can be more efficient to store items in a collection than in an array.



If you need to change the size of an array, you must use the ReDim Statement (Visual Basic). When you do this, Visual Basic creates a new array and releases the previous array for disposal. This takes execution time. Therefore, if the number of items you are working with changes frequently, or you cannot predict the maximum number of items you need, you might obtain better performance using a collection.

A collection, which does not have to create a new object or copy existing elements, can handle resizing in less execution time than an array, which has to use ReDim. But if the size does not change, or changes only rarely, an array is likely to be more efficient. As always, performance is highly dependent on the individual application. It is often worth your time to try both an array and a collection.

This Example

How to compare two Treeviews in VB2010
How to return the differences between two Treeviews

Solution

- Create Visual Basic 2010 Windows Application Project
- On Form1, place two tree views and two textboxes and one button

Visual Basic Online Course
Visual Basic 2010 Compare Strings from Treeview
How does it work ?
- Store the Treeview1 [TRV1] nodes into Textbox, and the same with Treeview2 [TRV2]
- How many strings [Lines] in each Textbox

  • We want to find where both Textboxes is different and where both Textboxes is match to one another. For example, differences are :
- TRV1 has an extra string [Southern American]
- TRV2 node string [Africa] is different from TRV2 node string [African]

Steps to accomplish this task :





Download example from Mediafire
Extended work :
You can easily extract any Database tables, columns Schema into a treeview control, and you can also using this example compare two tables or two columns in a Database using this example as well.

You can use ListViews or ComboBoxes or ListBoxes instead of the Treeview control, I used the treeview control because it's always tricky to work with. Using other controls that store strings in Collection format would be so easy, even much easier than using Treeviews.

Another Treeview Examples

Expand and Collapse two treeviews at the same time according to one another even if they both don't have the same nodes names. Expand TreeView1[TRV1] node when TreeView2 [TRV2] node is expanded or collapsed.

TreeView Example : Change the node font

TreeView Example : Add a photo (icon) to the TreeView
1) Add ImageList from the ToolBox
2) Add 2 photos to the ImageList1 [From properties, Collection], for example :
- Photo1.Png (Index by default is Zero 0), this will be the Parent icon
- Photo2.Png (Index by default is One 1), this will be the first child icon
3) Code to display image/Icon in the Tree View :


Here are some online Visual Basic lessons and courses :

Sunday, August 11, 2013

Visual Basic Online Course FlexGrid

Visual Basic 2010 - FlexGrid

Visual Basic 2010 FlexGrid
Visual Basic 2010 FlexGrid
The Microsoft FlexGrid (MSFlexGrid) control displays and operates on tabular data. It allows complete flexibility to sort, merge, and format tables containing strings and pictures. When bound to a Data control, MSFlexGrid displays read-only data.

You can put text, a picture, or both, in any cell of an MSFlexGrid. The Row and Col properties specify the current cell in an MSFlexGrid. You can specify the current cell in code, or the user can change it at run time using the mouse or the arrow keys. The Text property references the contents of the current cell.

If the text in a cell is too long to display in the cell, and the WordWrap property is set to True, the text wraps to the next line within the same cell. To display the wrapped text, you may need to increase the cells column width (ColWidth property) or row height (RowHeight property).

Use the Cols and Rows properties to determine the number of columns and rows in an MSFlexGrid.

Note : Before you can use an MSFlexGrid in your application, you must add the MSFlxGrd.ocx file to your project. To automatically include the file in your project, put it in the Autoload file. When distributing your application, you should install the MSFlxGrd.ocx file in the users Microsoft Windows System directory. For more information about adding an ActiveX control to a project, see "Standard ActiveX Controls" in the Visual Basic Programmers Guide.

How to add a FlexGrid component to Visual Basic .Net Form ?

- MSFLXGRD.OCX is a COM not a Net component but it can be added to a .Net Form in Visual Basic 2010 and work with it. In order to do so :

1) Open Visual Basic 2010 - New Project - Windows Form Application
Visual Basic 2010 Online Courses Free
Visual Basic Windows Form Application
2) Make sure you are displaying the design mode of the Form1.vb, to be able to choose components
Visual Basic 2010 online courses free
Visual Basic 2010 Form Design Mode
3) From Tools at the left side of the form, right-click anywhere and there will be a list, choose [Choose Items....]




Visual Basic Online Courses
Visual Basic 2010 Tools - Add FlexGrid
4) You will notice a new dialog box is opened where you get to pick up .Net components and Com components, click on the Tab with COM Components, then navigate to [Microsoft FlexGrid Control].

FlexGrid in VB2010 .Net
Visual Basic 2010 - Adding FlexGrid to Form
5) Click OK. Now from Tools, navigate to the end of the current section and you will file [Microsoft FlexGrid Control], just drag it on the Form or Double-Click it to be placed automatically on the Form
Visual Basic Online Courses
FlexGrid in VB2010 .Net Form
6) Now you successfully placed a COM component on .Net Form. Visual Basic 2010 will automatically convert this COM component into .Net component when Building your application.

Here are some online Visual Basic lessons and courses :

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 :

Friday, June 21, 2013

Visual Basic Online Course The following control could not be licensed: TxTextControl.TextControl

The following control could not be licensed: TxTextControl.TextControl

Search Optimization, Word Processing Integration
Tx TxtControl, powerful tool for VB2010 that enhances Word Processing Integrations

How to compile a specific license (*.licx) file to your Visual Basic 2010 project for example the [Tx TxtControl] Object. Tx TxtControl is an evaluation product and can be downloaded from here, unless you register the product with a standard license, it will not work properly with Visual Basic 2010

Tx TxtControl is a Visual Basic .Net powerful tool that enable you to create a Word Processing Integration form to enable the user to take notes and save it and retrieve it. With Tx TxtControl you can do the following :
  • Integrate comprehensive word processing into your Windows applications
  • Load, edit and save Microsoft Word formats (DOCX, DOC, RTF etc.)
  • Build powerful reporting and mail merge applications
  • Load, edit and create Adobe PDF documents
  • Completely royalty-free
The problem is that the Eval. Version pops up a message in the IDE and the Run-Time and generate an error message :
The following control could not be licensed: TXTextControl.TextControl
Visual Basic .Net 2010 Tx TxtControl Cracked
Tx TxtControl License Problem in Visual Basic .Net (VB2010)
To solve the Tx TxtControl license problem, you need to do the following :
1) Add Reference to Tx TxtControl in your Visual Basic 2010 Project
Visual Basic 2010 Online Courses and Solutions
Add Reference to Tx TxtControl in Your VB2010 project
2) A 'licenses.licx' file must exist in the 'My Project' folder. To build such a file, create a new text file in this folder and name it 'licenses.licx'. Open the file and add the following string: 
TXTextControl.TextControl, TXTextControl, Version=13.0.500.500, Culture=neutral, PublicKeyToken=6b83fe9a75cfb638
The 'licenses.licx' file is not a TX Text Control specific file, but a Visual Studio file that is used by 'lc.exe' (which is part of the .NET SDK) to compile the licenses into the assembly. These above steps are done automatically, if you drag and drop a TextControl from the toolbox onto a form.

The above line that refers to the License will vary from version to another. To find the proper License file for the existing Tx TxtControl Version for VB.Net WinForms :

  • Go to the C:\ drive and locate the installation folder for Tx TxtControl
  • You will find the License for the current version most likely here :
    C:\Users\User_Name\Documents\TX Text Control 19.0.NET for Windows Forms\Samples\WinForms\VB.NET\TX Text Control Words\My Project
  • You will find the License.Licx file placed there
  • Open it, copy the contents
  • Open your Visual Basic 2010 Project. Folder [My Project] add *.txt file and call it License.Licx if it is not already there and paste the previous copied lines
  • [If you found License.Licx there already, just open it with NotePad and add the following to the end of it]
  • Save all you work, Build Solution for your Project.
Here are some online Visual Basic lessons and courses :

Wednesday, June 19, 2013

Visual Basic Online Course Search Optimization

dtSearch Engine
Using dtSearch Engine to Create Search Optimization via Visual Basic 2010

Create Visual Basic .Net Search Optimization tool using dtSearch Engine to :

 Optimize Search
Index files
Search Index
Retrieve Search Results
Highlight Search Results
dtSearch Engine : Powerful tool can be downloaded from its official website. There is the dtDeskTop Search and dtSearch Engine for developers, we need the last one to be downloaded. You will be given a password to install the Eval. Version of dtSearch Engine by the customer support team via Email or via SkyPe. I recommend downloading the dtSearch Engine 772.

After installing dtSearch Engine successfully on your machine, you will find the files in the C:\ drive and Start Menu. Restart your machine.
Search Optimization
dtSearch Engine - installed files
There will be VB.Net examples in the C:\ drive cover most of the supported programming languages by the dtSearch Engine Tool including VB.Net 2010 [.Net frameWork 4] in this folder (C:\Program Files\dtSearch Developer\examples\vb.net4).

dtSearch Engine mechanism goes like this :

  • Create Indexes (If exists, then you can update the existing Index)
  • Add Files to be Indexed
  • Search Index
  • Retrieve Search Results (Highlight search results)

From Visual Basic .Net 2010

In order to use dtSearch Engine within VB2010 you will need :
      1. Create new Visual Basic 2010 Project
      2. Add dtSearch Engine Reference Files.
dtSearch Engine Reference Files to be added to the VB2010 project, are :
dtSearch Engine Optimization via Visual Basic .Net
dtSearch Engine via Visual Basic .Net (framework 4.0)
Not only searching System Files but also you can Search Database using the same mechanism (Create Index, Add Resources to Index, Search Indexed Resources, .... ,etc.)
Here is a source code example well detailed and explained of How to use dtSearch Engine to Optimize Search "Optimization" via VB.Net 2010 and .Net framework 4.0.

Using dtSearch Engine in Visual Basic .Net 2010 [Source Code Example] :
(1) dtSearch Engine - Logic and Design
(2) dtSearch Engine - Indexing/Searching local Files

Here are some online Visual Basic lessons and courses :

Visual Basic Courses - Share