77) An example of common dialog control?

An example of common dialog control. Before using common dialog control on the form, place a TextBox on the form and change its name to TextMessage. Insert three menus such as file menu, format menu and colors menu using menu editor dialog box. In the file menu, add three commands such as open, save as... Continue Reading →

Advertisements

76) Design a form and write program in visual basic for a random-access file. The random-access file name and balance. Name of this random file is customer.dat. After input records in random access file, enter customer type, customer number, name and amount from keyboard. Customer number is record number and customer type is either 1 or 2. If customer type is 1, add the amount in his balance and if customer type 2 subtract the amount from his balance?

Private Type Record     EName As String * 20     Balance As String * 5 End Type Private Sub Command1_Click()     Dim Employee As Record, CName, Check As String     Dim Amount, CT, CN, RecNo As Integer     Open "Customer.dat" For Random As #1 Len = Len(Employee)     Check = "Y"     RecNo = 0... Continue Reading →

75) Design a form and write a program in visual basic for a random-access file. Input some record in the file. Record contains name and total marks and name of this random file is marks.dat. After appending record in the file, add 10 marks in any one record in that file by calling it using get statement?

Private Type Student     SName As String * 20     TM As String * 3 End Type Private Sub Command1_Click()     Dim MyRec As Student, Check As String, RecNo, SearchNo As Integer     Open "Marks.dat" For Random Access Read Write As #1 Len = Len(MyRec)     RecNo = 0     Check = "Y"     Do... Continue Reading →

74) An example of random access file

Private Type RecordType     SName As String * 20     Tm As String * 3 End Type Private Sub Command1_Click()     Dim MyRec As RecordType, Check As String, RecNo, SearchNo As Integer     Open "Marks.dat" For Random As #1 Len = Len(MyRec)     RecNo = 1     Check = "Y"     Do While Check =... Continue Reading →

73) Design a form and write a program in visual basic for output file. The output file contains roll no, name and total marks of some student. Name of this output file is marks.dat. Append some record in same output file. Number of record can be input by the user from keyboard until he wants?

Private Sub Command1_Click()     Dim SName As String     Dim rn, tm As String     Open "Marks.dat" For Append As #1     rn = 1     Do While rn > 0         SName = InputBox("Enter Student Name", "String")         rn = InputBox("Enter Roll No", "Integer")         tm = InputBox("Enter Total Marks", "Integer")         If rn... Continue Reading →

72) Design a form and write a program in visual basic to input roll no and total marks of 10 students from keyboard. Write roll no and total marks of those students to pass.dat file which total marks is greater than or equal to 300. Write roll no and total marks of remaining student to fail.dat file?

Private Sub Command1_Click()     Dim i, rn, tm As Integer     Open "Pass.dat" For Output As #1     Open "Fail.dat" For Output As #2     For i = 1 To 10         rn = InputBox("Enter Roll No ", "Integer")         tm = InputBox("Enter Total Marks ", "Integer")         If tm >= 300 Then             Write... Continue Reading →

71) Design a form and write a program in visual basic to input roll no and name and marks of three subject from keyboard. Write roll no and name of only those students to an output file which marks of each subject is greater than equal to 35. Name of output file is student.txt. Also, count and print how many students which roll no and name not write to output file. Total number of student are 10?

Private Sub Command1_Click()     Dim SName As String     Dim rn, i, c, s1, s2, s3 As Integer     Open "Student.txt" For Output As #1     c = 0     For i = 1 To 10         SName = InputBox("Enter Student Name ", "String")         rn = InputBox("Enter Roll No ", "Integer")         s1 =... Continue Reading →

70) Design a form and write a program in visual basic to input name and roll no of 5 students from keyboard and write it to an output file named as student.dat?

Private Sub Command1_Click()     Dim SName  As String     Dim rn, i As Integer     Open "Student.dat" For Output As #1     For i = 1 To 5         SName = InputBox("Enter Student Name", "String")         rn = InputBox("Enter Roll No", "Integer")         Write #1, SName, rn     Next i     Close #1 End... Continue Reading →

69) Design a form and write a program in visual basic to input employee code, employee name and address of some employees from one input data file named as employee.txt and in array. Input basic pay, DA, HRA, medical from second input data file named as salary.txt in an array. Both data files contain same number of records. Calculate gross pay with formula basic pay + DA + HRA + medical. Print employee code, employee name, address and calculated gross pay in ascending order on gross pay?

Private Sub Command1_Click()     Dim STemp, EName(1 To 100), Address(1 To 100) As String     Dim i, j, x, ITemp, Code(1 To 100), Basic(1 To 100), DA(1 To 100), HRA(1 To 100), Medical(1 To 100), Gross(1 To 100) As Integer     Open "Employee.txt" For Input As #1     i = 0     Do While Not... Continue Reading →

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: