Loading...

Creating a Horizontal Drop Down Navigation Menu in VB 6

WORKING WITH SOME FORM

Adding a form in the project:

Menu Project - Add Form
- Form new
- Form that has been stored (existing), provided the form name (Name property value on the form to be added) should not be the same.
To get started, by Using the Menu
Tools menu - Menu Editor















In the menu editor, the contents of 'CAPTION' with the sub tab which will appear on the horizontal menu. Examples of "FILE", the column 'NAME' is also filled same the contents 'CAPTION'.













You can see in the example above. But do not forget to click next, to continue with the next command.

Then, to create a drop down menu. You just have to add click the arrow to right.













Click OK to terminate the horizontal menu editing.
And the result like this:

Readmore..

Bookmark and Share

How to use Control Structure IF - THEN in VB 6

Use of Control Structure IF


1.1 Understanding the Control Structure


Control structures in programming languages ​​is the command of the form (structure) that is used to set specific (control) the course of the program.



Visual Basic 6 recognizes two types of control structures, namely:

1. Decision control structures - used to decide a program code, which will be done based on a condition.

2. Repetition control structures - used to perform the repetition code. Will be discussed in the next chapter.



There are two forms of decision control structures, namely:


1. IF ... THEN structure.


2. SELECT ... CASE structure.


Forms of writing (syntax) IF ... THEN structure, are as follows:


1. IF THEN
If is True then the will be done.
END IF

2. IF THEN

ELSE

END IF

3. IF THEN

Elseif then

ELSE

END IF

example:
If x> 10 then
X = x +1
else
X = x
ENDIF

If the value of> 9 then
Description = "very good"
Elseif value> 7 then
Description = "good"
Elseif value> 6 then
Description = "sufficient"
else
Description = "no pass"
ENDIF

If is True then will be done, but if then the value False to be done.

As an exercise, try creating a login form as shown below.














And below is its coding.

Private Sub cmdlogin_Click ()
If txtuser.Text = "administrator" Then
'if the user filled the administrator
If txtpass.Text = "admin" Then
'if the password is filled in admin
x = MsgBox ("Username and password is accepted, please enter", vbOKOnly, "Success")
'come up with a message
load formulirisian
'open form form field
formulirisian.Show
'show the form the form field
login.Visible = False
'login form is displayed
else
'if the password is not admin
x = MsgBox ("Username and password does not match", vbOKOnly, "Failed")
'come up with a message
unload Me
'out of the program
end If
else
'if the user is not an administrator
x = MsgBox ("Username and password does not match", vbOKOnly, "Failed")
'come up with a message
unload Me
'out of the program
end If
end Sub
Readmore..

Bookmark and Share

Validation keypress and msgbox on VB 6.0

How to implement the keypress event and message validation to MsgBox ()

> EVENT keypress ()
Command is given at this event, will run at a keyboard button is pressed. In reading the input (knowing the keyboard button is pressed), using variable keyascii, where the value of keyascii will indicate which button is pressed. To know the value of each button, can be done by pressing the F2 key so the display will show the Object Browser:















The examples use keypress event include:

1. At the time the enter key is pressed

Private Sub tatnim_KeyPress (KeyAscii As Integer)
Then If KeyAscii = vbKeyReturn
txtname.SetFocus
end If
end Sub

2. An entry should only be filled in figure only

Private Sub Text5_KeyPress (KeyAscii As Integer)
If KeyAscii <48 Or KeyAscii> 57 Then
KeyAscii = 0
end If
end Sub

3. At the time of filling a textbox automatically be using capital letters

KeyAscii = Asc (UCase (Chr (KeyAscii)))

4. etc.

> Message Validation with msgbox ()

Command to display a message, which will appear in the form of a message box.
Can be given with the command:

Private Sub Command1_Click ()
x = MsgBox ("Do you want to save the changes of perttemuan 5", VBYesNoCancel, "Microsoft Office Word")
end Sub

Description:
*) X: variable name (free)
*) MsgBox: functions of message box displays
"Do you want to save the changes of perttemuan 5": the message is in the box
*) VBYesNoCancel: three buttons Yes, No, Cancel
"Microsoft Office Word": author / title of the message box
Readmore..

Bookmark and Share

Create Upload File On Server

To be able to follow this tutorial, you can be sure the web server to handle file uploads. My advice, use XAMMP.
To verify, open the following URL: localhost / xammp then click the phpinfo () that exist on the left. There will be seen that the value file_upload is ON.
Now we must first learn to create a form that is used to upload files. On creating a form that is ready to upload, you must add the attribute enctype = "multipart / form-data". To make the file size restrictions, use a hidden variable that is named MAX_FILE_SIZE and express it in bytes.

<html>
<head>
<title>From Upload</title>
<body>
Please upload your file
<br/>
Makximum size is 1 Mb<br/>
<form enctype="multipart/form-data" action="upload.php" method="post">
<input type="hidden" name="max_file_size" value="1048576">

Pilih file yang akan di upload:
<input name="userfile" type="file"> <br/>
<input type="submit" value="send file">
</form>
</body>
</html>


In listing 2, Perhtikan that the folder used to store uploadharus be writable by the server. If you use another operating system like Linux. adjust the writing style storage folder with the following, / upload or / home / user / upload.
The following listing and coding of two to manage file uploads:

<html>
<head>
<title>Upload file</title>
</head>
<body>
<?php $lanjut = 0;
switch($_FILES['userfile']
['error'] {
case 0;
echo "Upload Success"
$lanjut = 1;
break;
case1:
echo "file exceeds the specified limits"
break;
case 2:
echo "file exceeds the specified limits"
break;
case 3:
echo "only some files, which successfully uploaded"
break;
case 4:
echo "no file was uploaded"
break;
case 5:
echo "there is a problem on the server"
break;
}
if ($lanjut = 1) {
?>

<br/> <br/>
Following information from the file successfully uploads
<br/><br/>
Name File : <?php echo $_FILES['userfile'] ['name']?> <br/>
Type file : <?php echo $_FILES['userfile'] ['type']?> <br/>
Size file : <?php echo $_FILES['userfile'] ['size']?> bytes.

<?php
$upload_filename = 'E:\\ UPLOAD\\" . $_FILES['userfile' ['name'];
copy($_FILES['userfile']['tmp_name'],$upload_filename);
}
?>
</body>
</html>

Good luck.
Readmore..

Bookmark and Share

Installing Joomla in Localhost



1. INSTALL XAMP

Joomla Installation requires a localhost server when offline on your computer. If you use a Windows operating system is one of the localhost server that you can use is XAMPP. Apache Web Server, MySQL, PHP needed to build a web server is already include in it.

The steps to install XAMP:

1. Run the file xamp

2. After the install process is complete the next, (1) in the XAMPP Control Panel running Apache and MySQL, click start, or, (2) Run C: \ xampp \ xampp_start.exe.

3. Open a web browser (Internet Explorer, Mozilla, Opera), I recommend you to use Mozilla Firefox. Type http://localhost in the url address. If the image like the one below appears select the language you want (Home).


4. Open a web browser (Internet Explorer, Mozilla, Opera), I recommend you to use Mozilla Firefox. Type localhost in the url address. This means the localhost server is already in operation and the next is ready to install Joomla.

INSTALL JOOMLA

1. Create a folder with the name of Joomla (you can just use another name) in C: \ xampp \ htdocs \.
2. Joomla 1.0.15 Extract the zip file (that you downloaded earlier) into the folder.
3. Make sure XAMPP operate and open your web browser.
4. Type the address http://localhost/joomla (named after the folder you created) and press enter.
5. Now you come to the stage of the installation, just follow the rules.

At the time of installation of Joomla CMS, please use the data as below, on 'mSQL' Database configuration.

(1) hostname: localhost;
(2) MySQL: root,
(3) MySQL Password: (leave blank if you do not enter a password during the installation of XAMPP),
(4) MySQL Database Name: Joomla (not necessarily-as you see fit);
(5) MySQL Table Prefix: (leave it alone);

NB: For Database name, adapted by the time you create a database in phpmyadmin.
Readmore..

Bookmark and Share