Skip to main content

Write a VB program to accept the details of doctor having field s dno, dname, address, and phone number. Display those details on to the grid.

· One min read
Kaustubh Kulkarni
file.vb
Private Sub Command1_Click()  
Static i As Integer
For j = 1 To MSFlexGrid1.Cols 1
MSFlexGrid1.Row = i + 13
MSFlexGrid1.Col = j
MSFlexGrid1.Text = Text1.Item(j)
Text1.Item(j) =
Next
i = i + 1
End Sub

Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()

Dim Items(6) As String
Dim i As Integer
MSFlexGrid1.Col = 0
MSFlexGrid1.Row = 0
MSFlexGrid1.Text = Sr.No
For i = 1 To MSFlexGrid1.Rows 1
MSFlexGrid1.Col = 0
MSFlexGrid1.Row = i
MSFlexGrid1.Text = i
Next

MSFlexGrid1.Row = 0
MSFlexGrid1.Col = 1
MSFlexGrid1.Text = Doctor No
MSFlexGrid1.Col = 2
MSFlexGrid1.Text = Doctor Name
MSFlexGrid1.Col = 3
MSFlexGrid1.Text = Address
MSFlexGrid1.Col = 4
MSFlexGrid1.Text = Phone Number

For i = 1 To MSFlexGrid1.Cols 1
MSFlexGrid1.ColWidth(i) = 1300
Next
End Sub