Walk Lightly on this PLANET and yet leave such a FOOTPRINT that cannot be erased for thousands of Years..!!!
Visit Codstech for Cyber Security related Posts !

Visitors

Friday, July 1, 2011

VB-29 : Generate a bill for a ready-made garment store

Write an event procedure to generate a bill for a ready-made garments store.Assumptions can be made wherever necessary.

A) Program Design : 
User will enter Item Name,Unit Price and Quantity purchased for each different items.

(B) Property(Controls Used) :

  1. Grid                                         :   rows-10 , cols-4 , fix rows-1 , fix cols-0 (Click Project--> components and select microsoft flexGrid Control 6.0 to place a Grid Control on the form)
  2. Command Button         :    Caption-Add
  3. Label1                            :   Caption-Item
  4. Label2                            :   Caption-Price
  5. Label3                            :   Caption-Qty
  6. Label4                            :   Caption-Total
  7. TextBox1                       :   Text-(Blank)
  8. TextBox2                       :   Text-(Blank)
  9. TextBox3                       :   Text-(Blank)
  10. Label5                            :   Caption-Modern Garment Shop,Font Size-14,Alignment-Centre
(C) Attaching Code to the Object :



Dim sum As Single
Private Sub Command1_Click()
If Trim(Text1.Text) = "" Then
MsgBox "Item Name is missing"
Text1.SetFocus
GoTo endp
End If
End Sub

ElseIf Trim(Text2.Text) = "" Then
MsgBox "item price is missing"
Text2.SetFocus
GoTo endp

ElseIf Val(Text2.Text) = "" Then
MsgBox "Item Quantity is missing"
Text3.SetFocus
GoTo endp

ElseIf Trim(Text3.Text) = "" Then
MsgBox "Item Quantity is missing"
Text3.SetFocus
GoTo endp

ElseIf Val(Text3.Text) <= 0 Then
MsgBox "Item Quantity must be positive.Enter again"
Text3.SetFocus
GoTo endp

Else           'if all inputs are validated,make entry in list

grid1.Col = 0
grid1.Text = Trim(Text2.Text)
grid1.Col = 1
grid1.Text = Trim(Text2.Text)
grid1.Col = 2
grid1.Text = Trim(Text3.Text)
grid1.Col = 3
item_total = Val(Text2) * Val(Text3)
grid1.Text = item_total
sum = sum + item_total
Text4.Text = sum

grid1.Row = grid1.Row + 1
End If
endp:
End Sub

Private Sub Form_Load()

sum = 0

grid1.ColWidth(0) = 2000
grid1.ColWidth(1) = 1200
grid1.ColWidth(2) = 500
grid1.ColWidth(3) = 1300

grid1.Row = 0
grid1.Col = 0
grid1.Text = "Item Name"

grid1.Col = 1
grid1.Text = "Item Price"

grid1.Col = 2
grid1.Text = "Qty"

grid1.Col = 3
grid1.Text = "Item Total"

grid1.Col = 0
grid1.Row = 1

End Sub
(May be some error in the output...Find out...Please correct it using Create a Link  )

========================================================================== 
Back to Home   &  VB
=====

VB-28 : Encrypt a given string

Write an event procedure to encrypt a given string.Design an interactive user interface.Use approprite controls.
Assumptions : Encryption Logic is Display Next Character ,That is ,display b for a 


Refer another type of this Program Encryption and Decryption .


(A) Program Design :







(B) Property(Controls Used) :

  • 2 Labels                    :     Captions - Inut and Output) 
  • 2 TextBoxes              :    Delete Text 
  • 2 Command Buttons  :    Captions - Encrypt and Decrypt

(C) Attaching Code to the Object :

Private Sub Command1_Click()
Dim code_str As String
code_str = ""
For i = 1 To Len(Text1.Text)
ch = Mid(Text1.Text, i, 1)
code = Asc(ch) + 1
ch = Chr(code)
code_str = code_str + ch
Next
Text2.Text = code_str
End Sub
Private Sub Command2_Click()
Dim code_str As String
code_str = ""
For i = 1 To Len(Text1.Text)
ch = Mid(Text1.Text, i, 1)
code = Asc(ch) - 1
ch = Chr(code)
code_str = code_str + ch
Next
Text2.Text = code_str
End Sub


===========================================================================
Back to Home   &  VB

VB-27 : Playing a WAVE file(Using Windows API)

(Refer Multimedia Player)
The steps for playing a music file using windows Application Programming Interface(API).The steps are;

  1. Open VB and choose Standard EXE
  2. Choose a DriveList Box,Directory List Box and the File List Box, A Command Button whose caption is Play.



===========================================================================

(Not complete......)
Back to Home   &  VB