Wednesday, October 29, 2008

10 DATABASE MANAGEMENT SYSTEM AN GRAPHICAL USER INTERFACE USING VISUAL BASIC 6.0






'DATABASE MANAGEMENT SYSTEM AN GRAPHICAL USER INTERFACE USING VISUAL BASIC 6.0
'EXP NO 10 ACTIVE X PROGRAMMING
'**************CODE FOR FORM1*********************

Private Sub Command1_Click()
Print AddressCtl1.AddressText
End Sub

'*********CODE FOR ADDRESS CONTROL*******
Private Sub UserControl_Resize()
With UserControl
'Enforce minimum dimensions
If .Height < 3615 Then .Height = 3615
If .Width < 2175 Then .Width = 2175
'Resize objects on the control
txtName.Width = .ScaleWidth - 500
txtStreet.Width = .ScaleWidth - 500
txtCity.Width = .ScaleWidth - 500
txtZip.Width = .ScaleWidth / 2 - 500
txtState.Width = .ScaleWidth / 2 - 500
'Move the Zipcode text box
txtZip.Left = .ScaleWidth / 2 + 160
lblZip.Left = .ScaleWidth / 2 + 160
End With
End Sub

Public Property Get AddressText() As String
Dim s As String
s = txtName & vbCrLf
s = s & txtStreet & vbCrLf
s = s & txtCity & vbCrLf
s = s & txtState & vbCrLf
s = s & txtZip
AddressText = s
End Property

No comments:

Post a Comment

JTSEARCH