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

Wednesday, July 27, 2011

VB-71 : Create a Menu as per the format given

Create a Menu using Menu Editor as per the format given below :

FILE                                            EDIT                                 HELP
     New     CTRL+N                           Add
     Open    CTRL+O                        Change
     Save                                            Delete
     Save as
     Exit
        

Refer Program Using Menu Bar and Creating Tool Bar with Click Event 


===============================================
Here, File, Edit & Help is the Main Menu..and Others are sub-menus.....Given 2 Shortcuts for New & Open.
Refer Design a Menu Bar also.
Select Tools--> Menu Editor and create menus as per given below :









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

VB-70 : Program to provide information about yourself

Assume that you are doing a project in VB.Create a VB program to introduce yourself to the instructor and class. When the program is run,the program will provide the information about yourself...

(A)Program Design : 
(B) Property(Controls Used) :
  • 10 Labels (5+5)
  • One Command Button ( Close)
(C) Attaching Code to the Object :
Private Sub Command1_Click()
Unload Me
End Sub

(D) Output :
====================================================================




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

VB - 69 : Factorial of a Number

Write a VB program to collect a positive integer from the user and list all the factors in a multi-line textbox.
Note : The factor of an integer "n" is any integer that devides "n" completely.

Have a look at Print Even numbers upto n

Refer Collect and List positive integers  also.

(A)Program Design : 


(B) Property(Controls Used) :
  • 2 Labels "Input" and "Factors"
  • 2 Text Boxes (to input number from the user-Text1 and to display the result-Text2 (Multiline-True))
  • One Command Button(Generate Factors)

(C) Attaching Code to the Object :


Private Sub Command1_Click()
Dim no, i As Integer
no = Val(Text1.Text)
Text2 = ""
i = 1

While i <= no
If no Mod i = 0 Then
Text2 = Text2 & i
If i = no Then
Text2 = Text2 & "."
Else
Text2 = Text2 & ","
End If
End If
i = i + 1
Wend
End Sub


(D) Output :

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