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 13, 2011

VB-40 : Generating Initial from the given name

Collect the First Name,Middle Name and Last Name from the user on three separate text boxes and display the user's short name.

A)    Program Design : 

(B) Property(Controls Used) :
  •      4 Labels and their CAPTIONS are Enter First Name,Enter Middle Name,Enter Last Name and Initial is.
  •       One Command Button and its CAPTION is Generate Initial
  •       3 Text Boxes

(C) Attaching Code to the Object :
                 

Private Sub Command1_Click()
Dim str As String
str = ""
str = Mid(Trim(Text1.Text), 1, 1) + "."
str = str + Mid(Trim(Text2.Text), 1, 1) + "."
str = str + Mid(Trim(Text3.Text), 1, 1) + "."
Label4.Caption = "Initial is - " + str
End Sub

D)    Output : 



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

    No comments: