Monday, June 16, 2008

How to use Drivelistbox, Dirlistbox and Filelistbox

Good Day to my visitor. This sample codes all about Drivelistbox, Dirlistbox and Filelistbox. In this example you will learn on how to use these 3 basic controls in Visual Basic 6.




First Step: Create new project in Visual Basic 6. Then Input a Controls in Form1.
*label1, filename , Drivelistbox, Dirlistbox, and Filelistbox.





Second Step: Write these following codes.

Private Sub DirListBox_Change()
FileListBox.Path = DirListBox.Path
End Sub

Private Sub FileListBox_Click()
filename.Caption = FileListBox.filename
End Sub

Private Sub DriveListBox_Change()
Dim msg As String
Dim result As String

On Error GoTo Error
DirListBox.Path = DriveListBox.Drive
Exit Sub
Error:msg = "Error: " & Err.Number & ": " & Err.Description
result = MsgBox(msg, vbOKCancel + vbExclamation , "No Data")

If result = vbOK Then
Resume
Else
DriveListBox.Drive = DirListBox.Path
Err.Clear
Exit Sub
End If
End Sub

Wednesday, May 14, 2008

How to Clear all Text in a TextBox

First create a variable:
Dim Sayre As Control

Then Type this code in a Button:
For Each sayre In Me
If TypeOf sayre Is TextBox Then
sayre.Text = ""
End If
Next
####################################
Private Sub Command1_Click()
Dim sayre As Control

For Each sayre In Me
If TypeOf sayre Is TextBox Then
sayre.Text = ""
End If
Next
End Sub
####################################

Thursday, April 10, 2008

Visual Basic 6.0

Visual Basic (VB) is a third-generation event driven programming language and associated development environment from Microsoft for its COM programming model.[1] Visual Basic was derived from BASIC and enables the rapid application development (RAD) of graphical user interface (GUI) applications, access to databases using DAO, RDO, or ADO, and creation of ActiveX controls and objects. Scripting languages such as VBA and VBScript are syntactically similar to Visual Basic, but perform differently.[2]
A programmer can put together an application using the components provided with Visual Basic itself. Programs written in Visual Basic can also use the Windows API, but doing so requires external function declarations.
In business programming, Visual Basic has one of the largest user bases. In a survey conducted in 2005, 62 percent of developers reported using some form of Visual Basic. It currently competes with
C++, C# and Java for dominance in the business world. JavaScript is another competitor to Visual Basic.[3]
The final release was version 6 in 1998. Microsoft extended support will end in 2008 and the designated successor is Visual Basic .NET.
Other Information Click Me. - Topics from en.wikipedia.org