google.com, pub-4617457846989927, DIRECT, f08c47fec0942fa0 Learn to enjoy every minute of your life.Only I can change my life.

Monday, February 23, 2015

Write a Visual Basic Program to make customer Survey and with their name and then display the survey result.

Write a Visual Basic Program to make customer Survey and  with their name and then display the survey result.
------------------------------------------------------------------------------------------
Design Window:-
 First Form :-

Second form:-

Code;-
Dim Excellent As Integer
Dim Satisfactory As Integer
Dim Average As Integer
Dim Bad As Integer
Dim Total As Integer

Private Sub cmdContinue_Click()
If optExcellent.Value Then
    Excellent = Excellent + 1
ElseIf optSatisfactory.Value Then
    Satisfactory = Satisfactory + 1
ElseIf optAverage.Value Then
    Average = Average + 1
Else
    Bad = Bad + 1
End If
txtName.Text = ""
optExcellent.Value = False
optSatisfactory.Value = False
optAverage.Value = False
optBad.Value = False
txtName.SetFocus
End Sub

Private Sub cmdQuit_Click()
Total = Excellent + Satisfactory + Average + Bad
With frmServeyResult
    .lblExcellent = Excellent
    .lblSatisfactory = Satisfactory
    .lblAverage = Average
    .lblBad = Bad
    .lblExcellentPer = Format((Excellent / Total) * 100, "#0.00")
    .lblSatisfactoryPer = Format((Satisfactory / Total) * 100, "#0.00")
    .lblAveragePer = Format((Average / Total) * 100, "#0.00")
    .lblBadPer = Format((Bad / Total) * 100, "#0.00")
End With
frmServeyResult.Show
Unload Me
End Sub

========================================
OUTPUT
After entry of six customers response of first form survey result is:-



Write a Visual Basic program to find the mouse position on screen and number click made by user on screen.

Write a Visual Basic program to find the mouse position on screen and number click that is Left, Right and Double made by user on screen form .

First Design Form Window (mousepose.frm):-


Second Design Form Window (summary.frm):-

Code:- for first form

Dim cnt As Integer
Dim cnt1 As Integer
Dim cnt2 As Integer

Private Sub Command1_Click()
Form2.Show
Form2.Text1.Text = cnt
Form2.Text2.Text = cnt1
Form2.Text3.Text = cnt2
End Sub

Private Sub Form_DblClick()
cnt2 = cnt2 + 1
LblDblClick.Caption = cnt2
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
    cnt = cnt + 1
    LblLeftClick.Caption = cnt
End If
If Button = vbRightButton Then
    cnt1 = cnt1 + 1
    LblRightClick.Caption = cnt1
End If

End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim strpos As String
Dim xpos As Integer
Dim ypos As Integer

xpos = X
ypos = Y
strpos = "x : " & xpos & "   y : " & ypos
Label1.Caption = strpos
End Sub

Private Sub form_load()
cnt = 0
cnt1 = 0
End Sub

Private Sub LblRightClick_Click()

End Sub



------------------------


Code for Second form summary form:-
Design Window:-

Private Sub Command2_Click()
Unload Me
End Sub
============================================
OUTPUT




Second Output of Summary :-




अच्छे विचार करे विचार

  पहचान की नुमाईश, जरा कम करें... जहाँ भी "मैं" लिखा है, उसे "हम" करें... हमारी "इच्छाओं" से ज़्यादा "सुन...